Find and locate external references in drawings

Find and locate external references in drawings

sunchuanpu
Enthusiast Enthusiast
942 Views
2 Replies
Message 1 of 3

Find and locate external references in drawings

sunchuanpu
Enthusiast
Enthusiast

Hello,

I am using an external reference as frame for printing. Is there any ways to find and locate the external references using vba so I can quickly print multiple drawings?

I know the name of external reference. I will know relative locations of its four corners once if I can locate anything like insertion point. There might be multiple pages to print (an external reference used multiple times) in each drawing file. 

 

Thank you very much.

0 Likes
Accepted solutions (1)
943 Views
2 Replies
  • VBA
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

You can use code to open each drawing and loop through modelspace/each layout to check if there is an AcadExternalReference object, something like:

 

Dim ent As AcadEntity

Dim xref As AcadExternalReference

For Each ent In ModelSpace[PaperSpace]

  If TypeOf ent Is AcadExternalReference Then

    Set xref = ent

    '' Then examine its name/position... to decide if this is the target Xref and do things accordingly

    ... ...

  End If

Next

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

sunchuanpu
Enthusiast
Enthusiast
Many thanks!
0 Likes