XReference Path

XReference Path

Anonymous
Not applicable
374 Views
5 Replies
Message 1 of 6

XReference Path

Anonymous
Not applicable
How do you retrieve the path of an XRef using VBA in A2K? Using Autodesk's
examples, I can create a list of Xref names using IsXref but I haven't had
much luck figuring out how to create a list of Xref path's.

Thanks,
TM Amick II
0 Likes
375 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
The path property of the AcadExternalReference
object returns the fullpathname of an XRef

Denis
0 Likes
Message 3 of 6

Anonymous
Not applicable
I'm aware of this property. My problem is that I have been unsuccessful at
getting the command syntax correct.

TM

Denis Gagne wrote in message
news:893s57$mre10@adesknews2.autodesk.com...
> The path property of the AcadExternalReference
> object returns the fullpathname of an XRef
>
> Denis
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
TM

The path property will work only on an AcadExternalReference
found in the modelspace collection:

Dim oEntity As AcadEntity
For Each oEntity In ThisDrawing.ModelSpace
If TypeOf oEntity Is AcadExternalReference Then
ListBox1.AddItem (oEntity.Path)
End If
Next

Curiously the pathName information contained in an XRef block
record was not exposed to VBA. If, in your drawing, there's no
AcadExternalReference (suppose it has been deleted accidently),
I'm afraid there's no way to get the pathname of your XRef block
from VBA.

If the AcadExternalReference was inserted without retaining the
fullpathname, the path property won't return any path but only
the name of the referenced drawing

I can't see either how we could create an AcadExternalReference
from an XRef block. Very amazing.

Denis

TM Amick II a écrit dans le message :
893tv6$mqa17@adesknews2.autodesk.com...
> I'm aware of this property. My problem is that I have been unsuccessful at
> getting the command syntax correct.
>
> TM
>
> Denis Gagne wrote in message
> news:893s57$mre10@adesknews2.autodesk.com...
> > The path property of the AcadExternalReference
> > object returns the fullpathname of an XRef
> >
> > Denis
> >
> >
>
>
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thanks Denis. That worked like a charm.

Denis Gagne wrote in message
news:894ec0$otb8@adesknews2.autodesk.com...
> TM
>
> The path property will work only on an AcadExternalReference
> found in the modelspace collection:
>
> Dim oEntity As AcadEntity
> For Each oEntity In ThisDrawing.ModelSpace
> If TypeOf oEntity Is AcadExternalReference Then
> ListBox1.AddItem (oEntity.Path)
> End If
> Next
>
> Curiously the pathName information contained in an XRef block
> record was not exposed to VBA. If, in your drawing, there's no
> AcadExternalReference (suppose it has been deleted accidently),
> I'm afraid there's no way to get the pathname of your XRef block
> from VBA.
>
> If the AcadExternalReference was inserted without retaining the
> fullpathname, the path property won't return any path but only
> the name of the referenced drawing
>
> I can't see either how we could create an AcadExternalReference
> from an XRef block. Very amazing.
>
> Denis
>
>
>
> TM Amick II a écrit dans le message :
> 893tv6$mqa17@adesknews2.autodesk.com...
> > I'm aware of this property. My problem is that I have been unsuccessful
at
> > getting the command syntax correct.
> >
> > TM
> >
> > Denis Gagne wrote in message
> > news:893s57$mre10@adesknews2.autodesk.com...
> > > The path property of the AcadExternalReference
> > > object returns the fullpathname of an XRef
> > >
> > > Denis
> > >
> > >
> >
> >
>
>
0 Likes
Message 6 of 6

Anonymous
Not applicable
This is a pain, but it will work:
Use the insert method of the block object. This will give you an
AcadBlockReference that can be cast as AcadExternalReference, from which you
can get the path.
Then delete the AcadBlockReference:-(

> I can't see either how we could create an AcadExternalReference
> from an XRef block. Very amazing.
0 Likes