Path from Xref

Path from Xref

Anonymous
Not applicable
386 Views
4 Replies
Message 1 of 5

Path from Xref

Anonymous
Not applicable
Does anyone know how to get the path from an Xref? There doesn't seem to be an easy way to do this.

Thanks,
Marc
0 Likes
387 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
The ExternalReference object has a Path property. It is a pity that you
cannot get the info from the Blocks collection...

--
R. Robert Bell, MCSE
http://www.acadx.com


"mrhan" wrote in message
news:f090890.-1@WebX.maYIadrTaRb...
| Does anyone know how to get the path from an Xref? There doesn't seem to
be an easy way to do this.
| Thanks,
| Marc
|
|
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks for the info, but do you know how to link a AcadExternalReference
object to all the blocks and get the path? Can you loop thru the xrefs like
you can blocks? I have been able to look at all the blocks and find out if
they are xrefs (.isxref), but can't seem to figure out the object hierarchy
and how block objects and external reference objects are related. The help
files are pretty useless.

Thanks-Marc
R. Robert Bell wrote in message
news:E3C170259C9169CD90E977B077F515EB@in.WebX.maYIadrTaRb...
> The ExternalReference object has a Path property. It is a pity that you
> cannot get the info from the Blocks collection...
>
> --
> R. Robert Bell, MCSE
> http://www.acadx.com
>
>
> "mrhan" wrote in message
> news:f090890.-1@WebX.maYIadrTaRb...
> | Does anyone know how to get the path from an Xref? There doesn't seem to
> be an easy way to do this.
> | Thanks,
> | Marc
> |
> |
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Use the name property of the Block object to create a filtered selection
set. The objects contained in the selection set can be iterated as either
AcadBlockRefereces or AcadExternalReferences.

--
http://www.acadx.com

Good judgement comes from experience.
Experience comes from bad judgement.


"Marc Rhan" wrote in message
news:E98A599CFA12C4D5BEF1F4633E23E935@in.WebX.maYIadrTaRb...
> Thanks for the info, but do you know how to link a AcadExternalReference
> object to all the blocks and get the path? Can you loop thru the xrefs
like
> you can blocks? I have been able to look at all the blocks and find out
if
> they are xrefs (.isxref), but can't seem to figure out the object
hierarchy
> and how block objects and external reference objects are related. The
help
> files are pretty useless.
>
> Thanks-Marc
0 Likes
Message 5 of 5

Anonymous
Not applicable
Marc,

I believe this is what you're looking for?

Joe
----------------------------------------
Option Explicit

'DXF Group Code Constants
Public Const ENTITY = 0 'an entity

Public Sub XRefPath()
Dim objSS As AcadSelectionSet
Dim intFilterCode(0) As Integer
Dim strFilterValue(0) As String
Dim BlockRef As AcadBlockReference
Dim Index As Long

Set objSS = ThisDrawing.SelectionSets.Add("Inserts")

CreateSelectionSet objSS, ENTITY, "INSERT"

'MsgBox "Number of entities selected: " & objSS.Count

For Index = 0 To objSS.Count - 1
Set BlockRef = objSS(Index)
Debug.Print BlockRef.Path
Next Index

objSS.Delete
End Sub

Public Function CreateSelectionSet(SelectionSet As AcadSelectionSet, _
FilterCode As Integer, _
FilterValue As String) As Boolean
Dim intFilterCode(0) As Integer
Dim varFilterValue(0) As Variant

'assume success
CreateSelectionSet = True

intFilterCode(0) = FilterCode
varFilterValue(0) = FilterValue

SelectionSet.Select acSelectionSetAll, , , intFilterCode, varFilterValue
'SelectionSet.SelectOnScreen intFilterCode, varFilterValue

If Not SelectionSet.Count Then
CreateSelectionSet = False
End If
End Function

"Marc Rhan" wrote in message
news:E98A599CFA12C4D5BEF1F4633E23E935@in.WebX.maYIadrTaRb...
> Thanks for the info, but do you know how to link a AcadExternalReference
> object to all the blocks and get the path? Can you loop thru the xrefs
like
> you can blocks? I have been able to look at all the blocks and find out
if
> they are xrefs (.isxref), but can't seem to figure out the object
hierarchy
> and how block objects and external reference objects are related. The
help
> files are pretty useless.
>
> Thanks-Marc
> R. Robert Bell wrote in message
> news:E3C170259C9169CD90E977B077F515EB@in.WebX.maYIadrTaRb...
> > The ExternalReference object has a Path property. It is a pity that you
> > cannot get the info from the Blocks collection...
> >
> > --
> > R. Robert Bell, MCSE
> > http://www.acadx.com
> >
> >
> > "mrhan" wrote in message
> > news:f090890.-1@WebX.maYIadrTaRb...
> > | Does anyone know how to get the path from an Xref? There doesn't seem
to
> > be an easy way to do this.
> > | Thanks,
> > | Marc
> > |
> > |
> >
> >
>
>
0 Likes