Small change need on LISP , can anyone help?

Small change need on LISP , can anyone help?

designdistrict7
Advocate Advocate
768 Views
3 Replies
Message 1 of 4

Small change need on LISP , can anyone help?

designdistrict7
Advocate
Advocate

Hi,

I found one lisp program which will change object including block layer to bylayer , but this one have no option to select desired block, once it run entire drawing block and object will change to bylayer, can you edit and add one option to select desired block or object.

 

(defun c:All2BYLA nil
(vlax-for block (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for obj block
(if (wcmatch (vla-get-objectname obj) "AcDb*Dimension,AcDb*Leader,AcDb*MLeader")
(foreach prop '(Color DimensionLineColor ExtensionLineColor LeaderLineColor LeaderColor TextColor)
(vl-catch-all-apply 'vlax-put-property (list obj prop acbylayer))
)
(vl-catch-all-apply 'vla-put-color (list obj acbylayer))
)
)
)
(princ)
)
(vl-load-com) (princ)

0 Likes
Accepted solutions (1)
769 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

Does the SETBYLAYER command not do what you want?

Kent Cooper, AIA
0 Likes
Message 3 of 4

designdistrict7
Advocate
Advocate

No, this LISP will change all including leader & text which is not on bylayer inside block will change to 0 layer, SETBYLAYER will not adjust dimension text .

0 Likes
Message 4 of 4

designdistrict7
Advocate
Advocate
Accepted solution
0 Likes