Jump to content
ElCidCampeador

Exclude from macro a specific area of drawing

Recommended Posts

ElCidCampeador

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

Share this post


Link to post
Share on other sites
RICVBA

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)

Share this post


Link to post
Share on other sites
BIGAL

Like RICVBA look at the help for ssget "W" "F" "CP" this is lisp but the same in VBA

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×