- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to write a lisp to complete the following:
- Select objects where the linetype is set BYLAYER, with a specific linetype (e.g. "CENTER")
- Change/update the LTSCALE of those specific objects (e.g. make them 1.0)
I found it was quite easy for me to select all objects with a specific linetype by object and update the properties. For example:
(setq ss (ssget "X" '((6 . "CENTER"))))
(if (/= ss nil)
(progn
(command "chprop" ss "" "ltype" "CENTER2" "")
(command "chprop" ss "" "ltscale" "1" "")
); progn
(prompt "\nCENTER linetype not found\n")
I can update all linetypes set to BYLAYER to using the following code, but it doesn't update the LTSCALE as well:
(vlax-for layer (vla-get-Layers (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(if (= "CENTER" (vla-get-linetype layer))(vla-put-Linetype layer "CENTER2")))
I'd like to be able to modify the code above to both update the Linetype and the LtScale of the affected objects. I'm admittedly not very skilled with programming and writing lisps, but I've managed to get by following the many examples and generous assistance offered to others with similar queries on these forums. I would really appreciate any help to both understand and complete the code, just something simple that I can follow with my limited knowledge.
Thank you!
Solved! Go to Solution.