Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ObjectDBX access to block definition

4 REPLIES 4
Reply
Message 1 of 5
mdhutchinson
463 Views, 4 Replies

ObjectDBX access to block definition

Can't you access the block definition via ObjectDBX.

(without the dwg file being open)

 

I am parsing through the blocks to find all the xrefs. 

When I get to an XRef... I don't seem to find a way to check if it's an XRef.

Ideas?

 

4 REPLIES 4
Message 2 of 5
devitg
in reply to: mdhutchinson

Do you mean BLOCK or BLOCKREFERENCE ??

Message 3 of 5
devitg
in reply to: mdhutchinson

Yes it can be done at the BLOCK or at the  Block-reference (inserted)

Message 4 of 5
mdhutchinson
in reply to: mdhutchinson

I believe I found the answer on another post while researching...

I think this may be the only way is to check if the Block Reference actually has a 'Path property... (see code fragment below) if it does then it is an XRef.  If the drawing is open in AutoCAD then there is an IsXref property... but when the drawing is closed this particular propterty is not visible but the 'Path property is.

See also this post:

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/ObjectDBX-Detach-XRefs-AND-delete-all...

 

(and (eq (vla-get-objectname blkobj) "AcDbBlockReference")
        (vlax-property-available-p blkobj 'Path)
)

Message 5 of 5

Hi mdhutchinson,

If you are iterating the BLOCKS collection of the ObjectDBX Document; using the Name property of the Block Reference, then you can use vla-Item on the BLOCKS collection of the ObjectDBX Document to retrieve the block definition object for the block reference and then get the IsXRef property.

 

I would believe that the IsXRef property is accessible either in the current drawing or in an ObjectDBX Document.

 

Regards,

Trevor

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost