Jump to content

VBA how can I set the layer for a Line/Circle etc?


Recommended Posts

Posted

Ok...I know i have a lot of questions..and most of the time google can provide the answers, but specific questions need specific answers and for these you are the best.

Now, the question is simple. I have a polyline let's say myPline inside a routine in VBA that is drawn when the user clicks a button. How can i set the layer of that line from the layers inside the current project? (In this case the user has a set of specific layers he uses in all of his projects)

Posted

Each entity has the Layer property that can be set after the entity was added:

 

Set myLine = ThisDrawing.ModelSpace.AddLine(Point1st, Point2nd)
myLine.Layer = theLayer

 

Regards,

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...