Lee Mac Posted October 4 Posted October 4 Try modifying the ActiveX layer property, i.e. (defun c:clyr ( / ent lay ) (setq lay "YourLayerHere") (if (setq ent (car (entsel))) (progn (vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) lay) (vla-put-layer (vlax-ename->vla-object ent) lay) ) ) ) (vl-load-com) (princ) The code could obviously be made more efficient by caching the layer collection or document object, but it should get you going in the right direction. 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.