+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Newbie
    AutoCAD 2015
    Join Date
    Jul 2017

    Default Exclude from macro a specific area of drawing

    Registered forum members do not see this ad.

    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

  2. #2
    Full Member
    AutoCAD 2010
    Join Date
    Oct 2013


    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)

  3. #3
    Quantum Mechanic BIGAL's Avatar
    Civil 3D 2016
    Join Date
    Dec 2005


    Registered forum members do not see this ad.

    Like RICVBA look at the help for ssget "W" "F" "CP" this is lisp but the same in VBA
    A man who never made mistakes never made anything

Similar Threads

  1. how to place an object in specific area
    By ironart in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 13th May 2013, 08:32 pm
  2. macro to open from specific template
    By designerstuart in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 14
    Last Post: 17th Oct 2011, 03:28 pm
  3. Faster way of drawing specific radii archs in specific locations.
    By bbankston in forum AutoCAD Beginners' Area
    Replies: 9
    Last Post: 26th Dec 2010, 03:09 am
  4. Creating a macro for specific linetypes
    By Gratitude1977 in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 4
    Last Post: 30th Nov 2010, 12:38 pm
  5. Turn specific layer on or thaw with macro
    By tlove2012 in forum AutoCAD General
    Replies: 4
    Last Post: 20th Nov 2007, 05:49 pm

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts