himal Posted May 23, 2021 Posted May 23, 2021 hi, Please help me, I am finding command or lisp for multiple layout paper space select similar poly lines. Please see the attached , Thank you. 1.pdf Quote
maratovich Posted May 23, 2021 Posted May 23, 2021 What for? If you want to create Layouts or print : To automatically create Layouts by polyline use this - AutoViewport For automatic printing from Layouts and Model use this - Revers Quote
himal Posted May 23, 2021 Author Posted May 23, 2021 Thank you. This drawing viewport already done. I need to change paper space continuation line type change only. Quote
BIGAL Posted May 24, 2021 Posted May 24, 2021 If the lines are in the same location in every layout then yes could be done. Are they part of a title block then can edit the block BEDIT and all done. If they are the only objects on a layer then yes even easier. Change to layout get all plines on layer then use CHPROP all done, repeat for all layouts. Need a dwg to look at. Quote
himal Posted May 24, 2021 Author Posted May 24, 2021 Pls find the attached dwg. there is lot of layouts so its take time change. Pls check any way for that MTB.dwg Quote
tombu Posted May 24, 2021 Posted May 24, 2021 The only lines in any of the layouts are Match Lines with "Arrow Contin" blocks on each end. Modifying the lines will not move the blocks. What exactly are you trying to do? Quote
himal Posted May 24, 2021 Author Posted May 24, 2021 i want change that line type only. now it line type center i want to change it phantom line type and line type scale 25 Quote
dan20047 Posted May 24, 2021 Posted May 24, 2021 Do you have the SSX command? Available through the express tools I believe. Run the command, select an example line that you want to change, and I believe all similar lines, even in other layouts, will be selected. Then use the properties palette to change the linetype. It may also pick up lines in model space, but you could just deselect them manually. Quote
tombu Posted May 24, 2021 Posted May 24, 2021 (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (67 . 1) (8 . "0") (62 . 6) (6 . "CENTER2")))) (sslength ss) puts 173 lwpolylines in Paperspace on Layer 0 color 6 with linetype CENTER2 into selection set ss for you to modify however you wish. Quote
BIGAL Posted May 25, 2021 Posted May 25, 2021 Try this (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (67 . 1) (8 . "0") (62 . 6) (6 . "CENTER2")))) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (vlax-put obj 'Linetype "Phantom") (vlax-put obj 'LinetypeScale 0.25) ) 1 Quote
himal Posted May 26, 2021 Author Posted May 26, 2021 like this massage coming "; error: bad argument type: lselsetp nil" Quote
mhupp Posted May 26, 2021 Posted May 26, 2021 (edited) Give this a try (defun C:foo (/ lyt c tab SS) (setq lyt (getvar 'ctab)) (setq c 0) (setvar 'cmdecho 0) (if (not (tblsearch "ltype" "PHANTOM")) (vl-cmdf "._linetype" "_load" "PHANTOM" "default.lin" "") ; Might have to change to "Acadiso.lin" for AutoCAD ) (foreach tab (layoutlist) (setvar 'ctab tab) (setq SS (ssget "X" '((0 . "*POLYLINE") (6 . "Center2") (62 . 6) (cons 410 (getvar "ctab"))))) (vl-cmdf "_.Chprop" SS "" "LT" "PHANTOM" "") (setq c (+(sslength ss) c)) ) (setvar 'ctab lyt) (setvar 'cmdecho 1) (prompt (strcat "\n"(itoa c) " Poylines Changed")) (Princ) ) steps though each tab and Selects polylines that are color magenta & center2 line type then uses change properties to line type phantom goes back the the tab you had selected before you ran the command and prompt you to how many poylines where changed. --edit modified @BIGAL to check if phantom line is already loaded. i think thats the error your getting himal This works A LOT FASTER and cleaner. (defun C:foo (/ SS obj e) (vl-load-com) (if (not (tblsearch "ltype" "PHANTOM")) (vl-cmdf "._linetype" "_load" "PHANTOM" "default.lin" "") ; Might have to change to "Acadiso.lin" for AutoCAD ) (if (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (67 . 1) (8 . "0") (62 . 6) (6 . "CENTER2")))) (progn (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq obj (vlax-ename->vla-object e)) (vlax-put-property obj 'Linetype "PHANTOM") (vlax-put-property obj 'LinetypeScale 0.25) ) (prompt (strcat "\n" (itoa (sslength SS)) " Polylines Changed")) ) (prompt "\nNo Polyelins Change") ) (princ) ) Edited May 26, 2021 by mhupp Quote
mhupp Posted May 26, 2021 Posted May 26, 2021 On 5/24/2021 at 4:57 PM, tombu said: (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (67 . 1) (8 . "0") (62 . 6) (6 . "CENTER2")))) (sslength ss) puts 173 lwpolylines in Paperspace on Layer 0 color 6 with linetype CENTER2 into selection set ss for you to modify however you wish. I don't know if Bricscad is different but this didn't work for me I got an error 171 entities are not in the current space. Only changed the two that where on the current tab even tho the rest where in the selections set. I had to step thought each tab to change them like above. Quote
mostafa badran Posted May 26, 2021 Posted May 26, 2021 3 hours ago, himal said: like this massage coming "; error: bad argument type: lselsetp nil" you need to reload PHANTOM line type firstly then run BIGAL code. 1 Quote
tombu Posted May 26, 2021 Posted May 26, 2021 Added loading PHANTOM linetype to BIGAL's code. (or(tblsearch "ltype" "PHANTOM")(command-s "._linetype" "_load" "PHANTOM" "acad.lin" "")) (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (67 . 1) (8 . "0") (62 . 6) (6 . "CENTER2")))) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (vlax-put obj 'Linetype "Phantom") (vlax-put obj 'LinetypeScale 0.25) ) Quote
himal Posted May 27, 2021 Author Posted May 27, 2021 (edited) Thank You Its work now (reload the line type ) On 5/25/2021 at 9:56 AM, BIGAL said: Try this (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (67 . 1) (8 . "0") (62 . 6) (6 . "CENTER2")))) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (vlax-put obj 'Linetype "Phantom") (vlax-put obj 'LinetypeScale 0.25) ) Edited May 27, 2021 by himal Quote
himal Posted May 27, 2021 Author Posted May 27, 2021 10 hours ago, mostafa badran said: you need to reload PHANTOM line type firstly then run BIGAL code. Thank you now its work. Quote
BIGAL Posted May 27, 2021 Posted May 27, 2021 Thanks guys for adding linetype check. ; error : Automation Error 80200025; [IAcadLWPolyline] Error accessing [LINETYPE] property. ErrIndex=0; Invalid Symbol Table name Acad= Acad.lin Acadiso.lin Bricscad= Default.lin Use (vlax-product-key) to work out which software. A simple request becomes complicated. (if(tblsearch "ltype" "PHANTOM") (princ) (progn (if (wcmatch (vlax-product-key) "*BricsCAD*") (setq linetypename "Phantom" filename "Default.lin") (setq linetypename "Phantom" filename "Acad.lin") ) (vl-catch-all-apply 'vla-load (list (vla-get-Linetypes (vla-get-activedocument (vlax-get-acad-object)) LineTypeName FileName)) ) ) ) 2 Quote
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.