Jump to content

Exclude from macro a specific area of drawing


ElCidCampeador

Recommended Posts

Is it possible to exclude from a vba macro for Autocad a specific region? For example, apply this macro not to all modelspace but only to a part (which has not lines as boundaries but defined only by position reference x,y in autocad). Thanks

Link to comment
Share on other sites

I'd go this way:

- check every drawing entity to be handled by the macro against the intersections it has with the "allowed" region perimeter (which is likely to be a polyline)

- if there are no intersections then let the macro operate on that drawing entity

- if there is any intersection then skip that drawing element

 

as a side note for handling intersections, I guess you're working on a 2D model so be sure all elements and the region perimeter has the same "elevation" property

 

 

As an alternative you could use SelectionSet object and select only elements within a certain boundary.

and then have macro operate on every element (if any) of that selection set (just iterate over selection set items)

Link to comment
Share on other sites

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...