(defun c:p10 (/ ss i)
(setq ss (ssget))
(setq i 0)
(repeat (sslength ss)
(setq e (ssname ss i))
(if (= (cdr (assoc 0 (entget e))) "POLYLINE")
(command "pedit" e "w" "10" "x")
)
(setq i (1+ i))
)
(princ)
)
(princ "\nType p10 to invoke command.")
(princ)
Start the routine, pick the lines you want changed, and away it goes!
You can change the variables for the line width you want within the routine
or make a copy. I never did get back to change it to make the line width an
input variable. Maybe some day.
The problem I'm having is that it will not work consistantly in AutoCad
Map.
After a line is given a width, the routine stops working. It appears to run,
but does not change the widths anymore.
I'd appreciate any help.
Randy Williamson
GIS Co-ordinator
Palliser Municipal Services
Hanna, Alberta
ra...@telusplanet.net
Randy Williamson escribió:
I had the same problem with my function.
So I modified it to work with R14.
Here's the code.
;; This is function will modify plines, lines, arcs, and lwploylines
;; ============================================
(defun c:THK (/ Gwidth Groups Group-len Cnt Ent Ent-inf Ent-nam Ent-asc
Ent-han Ent-typ)
(prompt "\nSelect Entities...")
(setq Groups (ssget))
(setq Gwidth (getvar "offsetdist"))
(if Groups
(progn
(setq Group-len (sslength Groups))
(setq Cnt 0)
(prompt (strcat "\nEnter Line Width <" (rtos Gwidth 4 2)))
(setq Gwidth (getdist ">: "))
(if Gwidth (setvar"offsetdist" Gwidth))
(if (= Gwidth nil)(setq Gwidth (getvar "offsetdist")))
(setq Gwidth (abs Gwidth))
(repeat Group-len
(setq Ent (ssname Groups Cnt))
(setq Cnt (+ Cnt 1))
(setq Ent-inf (entget Ent))
(setq Ent-typ (cdr (assoc 0 Ent-inf)))
(setq Ent-nam (cdr (assoc -1 Ent-inf)))
(setq Ent-asc (cdr (assoc 10 Ent-inf)))
(setq Ent-han (list Ent-nam Ent-asc))
(cond
((= Ent-typ "LWPOLYLINE" )(command "pedit" Ent-han "w"
Gwidth "x"))
((= Ent-typ "POLYLINE" ) (command "pedit" Ent-han "w" Gwidth
"x"))
((= Ent-typ "LINE" ) (command "pedit" Ent-han "y" "w" Gwidth
"x"))
((= Ent-typ "PLINE") (command "pedit" Ent-han "w" Gwidth
"x"))
((= Ent-typ "ARC" ) (command "pedit" Ent-han "y" "w" Gwidth
"x"))
)
)
)
)
(princ)
)
--
Ru...@whainc.com
Programmer/Developer/MIS Assist.
Randy Williamson <ra...@telusplanet.net> wrote in article
<7q13ab$e7...@adesknews2.autodesk.com>...