TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: PM on October 19, 2022, 05:23:51 AM
-
Hi.I use this lisp to draw lines in specific layers. Some times i want this layers to contain polylines (close or open). So i want to add a option at the end of the code (before change layer to 0) ,and ask me "Do you want to convert to polyline? (Y/N)"
and some way using pedit command to join them (Not all the lines in the same layer, only the lines i draw with this command)
(command "_.pedit" "_M" "" "_Y" "_J" "" "")
(command "_layer" "_m" "Layer1" "_c" "15" "" "") );end if
(command "_line" "non" s1
"non" s2
"") )
; layer to 0
(mapcar '
setvar '
("clayer" "cecolor" "celtype" "celweight") (list "0" "BYLAYER" "BYLAYER" -1)) )
Thanks
-
any options?
Thanks
-
Why don't you draw polylines to start with? If in the end you want individual items simply explode it.
-
Jedna zamerka Ron,...
Pri samom izgovoru eksploud... Cinjenicno je nepotrebno iskazivati Nobelizam zarad fundamentalizma...
-
Thanks i fix it
(DEFUN C:test
(/ CONVERT S1 S2 SS
) (command "_layer" "_m" "Layer1" "_c" "15" "" "")
(COMMAND "_line" "non" S1
"non" S2
"") )
((getkword "\nConvert to polyline? [Yes/No] <N>: ")) ("No")
)
)
(= convert "Yes")
)
(command "_.pedit" "_M" ss
"" "_Y" "_J" "" "") (command "_.pedit" "_M" ss
"" "_J" "" "") )
)
)
)
(command "-linetype" "set" "Bylayer" "") )
-
Thanks i fix it
(DEFUN C:test
(/ CONVERT S1 S2 SS
) (command "_layer" "_m" "Layer1" "_c" "15" "" "")
(COMMAND "_line" "non" S1
"non" S2
"") )
((getkword "\nConvert to polyline? [Yes/No] <N>: ")) ("No")
)
)
(= convert "Yes")
)
(command "_.pedit" "_M" ss
"" "_Y" "_J" "" "") (command "_.pedit" "_M" ss
"" "_J" "" "") )
)
)
)
(command "-linetype" "set" "Bylayer" "") )
Why are you doing this ?
Draw a line .. ask if it should be a polyline, repeat. Sorry I don't get your logic at all. :wink:
FWIW, This line will prevent the code from ever running: (if (tblsearch "layer" "Layer1")