Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
mdhutchinson
Posts: 2,283
Registered: ‎11-18-2003
Message 1 of 5 (272 Views)

ObjectDBX access to block definition

272 Views, 4 Replies
02-22-2013 11:07 AM

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?

 

Mentor
devitg
Posts: 1,692
Registered: ‎03-14-2004
Message 2 of 5 (257 Views)

Re: ObjectDBX access to block definition

02-22-2013 03:04 PM in reply to: mdhutchinson

Do you mean BLOCK or BLOCKREFERENCE ??

Mentor
devitg
Posts: 1,692
Registered: ‎03-14-2004
Message 3 of 5 (254 Views)

Re: ObjectDBX access to block definition

02-22-2013 03:25 PM in reply to: mdhutchinson

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

Valued Mentor
mdhutchinson
Posts: 2,283
Registered: ‎11-18-2003
Message 4 of 5 (218 Views)

Re: ObjectDBX access to block definition

02-25-2013 05:55 AM 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)
)

Contributor
SonicSSV
Posts: 22
Registered: ‎06-30-2008
Message 5 of 5 (198 Views)

Re: ObjectDBX access to block definition

02-25-2013 07:33 PM in reply to: mdhutchinson

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community