vernonlee Posted March 10, 2015 Share Posted March 10, 2015 Currently using a LISP to change all line/entity to linetype scale 5. But it does not work more then 1 or 2 level nested deep. Any can help design one that can change all linetype scale in 1 click? Thanks This is the current LISP i am using:- (vl-load-com) (defun c:sst (/ ss scale blk eo doc blocks bcol) (if (and (setq scale (getreal "New scale: ")) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq ss (ssget)) (setq ss (vla-get-ActiveSelectionSet doc)) ) (progn (vlax-for eo ss (if (vlax-property-available-p eo 'LinetypeScale t) (vla-put-LinetypeScale eo scale) ) (if (and (eq (vla-get-ObjectName eo) "AcDbBlockReference") (not (vl-position (vla-get-EffectiveName eo) blocks)) ) (setq blocks (cons (vla-get-EffectiveName eo) blocks)) ) ) (setq bcol (vla-get-Blocks doc)) (foreach blk blocks (vlax-for eo (vla-Item bcol blk) (if (vlax-property-available-p eo 'LinetypeScale t) (vla-put-LinetypeScale eo scale) ) ) ) ) ) (princ) ) Reply With Quote (prompt "Enter sst to run.") (princ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 10, 2015 Share Posted March 10, 2015 Change the linetype scale for all objects in the drawing, or all objects in a selection? Quote Link to comment Share on other sites More sharing options...
vernonlee Posted March 10, 2015 Author Share Posted March 10, 2015 Change the linetype scale for all objects in the drawing, or all objects in a selection? All object in the drawing for the most part. There are a few occasions where I do need to select though. Thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 10, 2015 Share Posted March 10, 2015 All object in the drawing for the most part. Try the following: (defun c:lts ( / doc scl ) (initget 6) (if (setq scl (getreal "\nSpecify new linetype scale: ")) (vlax-for blk (vla-get-blocks (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (if (= :vlax-false (vla-get-isxref blk)) (vlax-for obj blk (if (and (vlax-write-enabled-p obj) (vlax-property-available-p obj 'linetypescale t)) (vla-put-linetypescale obj scl) ) ) ) ) ) (vla-regen doc acallviewports) (princ) ) Quote Link to comment Share on other sites More sharing options...
vernonlee Posted March 10, 2015 Author Share Posted March 10, 2015 Thanks lee. Will try when back in office tomorrow. But just to highlight I actually do need one base on selection after all. I will try the one that you have suggested first. Thanks. Quote Link to comment Share on other sites More sharing options...
vernonlee Posted March 11, 2015 Author Share Posted March 11, 2015 OMG lee, it works like PURE magic. Hope you can incorporate a selection option to this LISP Quote Link to comment Share on other sites More sharing options...
vernonlee Posted July 22, 2015 Author Share Posted July 22, 2015 Hi LEE, I have now encounter situations where I need to base on selections instead of the whole drawings. Could you incorporate a selection options (window & picking) for the LISP? Thanks Quote Link to comment Share on other sites More sharing options...
tombu Posted July 23, 2015 Share Posted July 23, 2015 So blocks with linetypes look the same no mater the insert or plot scale I've used: http://www.cadforum.cz/cadforum_en/how-to-explode-linetypes-to-dashes-tip6804 Quote Link to comment Share on other sites More sharing options...
vernonlee Posted July 24, 2015 Author Share Posted July 24, 2015 Hi LEE, I have now encounter situations where I need to base on selections instead of the whole drawings. Could you incorporate a selection options (window & picking) for the LISP? Thanks Thanks but not suitable for my work situation. Quote Link to comment Share on other sites More sharing options...
vernonlee Posted July 28, 2015 Author Share Posted July 28, 2015 Anyone can help? Quote Link to comment Share on other sites More sharing options...
tombu Posted July 28, 2015 Share Posted July 28, 2015 Are you trying to get the linetypes inside a block to display correctly? Quote Link to comment Share on other sites More sharing options...
vernonlee Posted July 28, 2015 Author Share Posted July 28, 2015 Are you trying to get the linetypes inside a block to display correctly? More specific is the linetype scale so that the dash line can be consistent throughout the whole drawing. LEE 's lisp is great & go many levels of nested blocks. But it will affect the whole drawing which due to a my new nature is work require a selecting specifi blocks only. Quote Link to comment Share on other sites More sharing options...
tombu Posted July 28, 2015 Share Posted July 28, 2015 More specific is the linetype scale so that the dash line can be consistent throughout the whole drawing. LEE 's lisp is great & go many levels of nested blocks. But it will affect the whole drawing which due to a my new nature is work require a selecting specifi blocks only. Linetypes inside blocks are problematic, they are affected by the scale they were inserted as well as changes in linetype scale. Easiest solution I've found is to use the LinExp.lsp downloaded from http://www.cadstudio.cz/en/download.asp?file=LinExp Edit the block and with the linetype scale adjusted to look the way you want explode them into dashes & dots. Once saved the block linetypes will display the same dashes & dots no matter the insertion scale or linetype scale. Quote Link to comment Share on other sites More sharing options...
vernonlee Posted July 28, 2015 Author Share Posted July 28, 2015 (edited) Linetypes inside blocks are problematic, they are affected by the scale they were inserted as well as changes in linetype scale. Easiest solution I've found is to use the LinExp.lsp downloaded from http://www.cadstudio.cz/en/download.asp?file=LinExpEdit the block and with the linetype scale adjusted to look the way you want explode them into dashes & dots. Once saved the block linetypes will display the same dashes & dots no matter the insertion scale or linetype scale. Yes, they are extremely problematic. Previously I spend hours going in many levels of nested blocks to manually change the lines type scale. I totally gave up. LEE's lisp ultimately saved me hours not to mention my sanity. Thanks for your suggestion But I need to retain my original lines & not break them into bits. Edited July 28, 2015 by vernonlee Quote Link to comment Share on other sites More sharing options...
sujan Posted July 24, 2017 Share Posted July 24, 2017 does not work for blocks. Quote Link to comment Share on other sites More sharing options...
reddredd Posted July 28, 2017 Share Posted July 28, 2017 1. LISP that can change hatch scale of a specific hatch in block (ex. ar-concrete) 2.LISP that can merge linetype (ex.from 111111111$0$hidden to hidden) Quote Link to comment Share on other sites More sharing options...
Blue2swing Posted August 4, 2021 Share Posted August 4, 2021 On 3/10/2015 at 5:45 AM, Lee Mac said: Try the following: (defun c:lts ( / doc scl ) (initget 6) (if (setq scl (getreal "\nSpecify new linetype scale: ")) (vlax-for blk (vla-get-blocks (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (if (= :vlax-false (vla-get-isxref blk)) (vlax-for obj blk (if (and (vlax-write-enabled-p obj) (vlax-property-available-p obj 'linetypescale t)) (vla-put-linetypescale obj scl) ) ) ) ) ) (vla-regen doc acallviewports) (princ) ) Thank you! This saved me a tremendous amount of work! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.