News:

Please note new Forum URL: forum.designcad.com

Main Menu

Symbols & Blocks

Started by tectonic, September 06, 2007, 06:47:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tectonic

Hi

I'm currently trying to access the text attribute of a block using VBA.

The block is in the form of a rectangle with a text attribute that I am trying to modify.

I am using DC V15 and able to insert a drwg as a symbol that contains the block.  After that I can't find out how to select the block and change its attributes.  ???

I am able to go thro' the process manually.

Does anyone have any pertinent   ;)  suggestions.

I'm aware the best solution is probably don't do it!


prl

As far as I know, accessing block attributes was never implemented for OLE.  You can get to them via basiccad though.

tectonic

Thanks prl.

I haven't gotten around to using basiccad at this point, can you point me in the right direction please?

prl

Quote from: tectonic on September 06, 2007, 08:25:54 PM
can you point me in the right direction please?

First thing, even if using version 15, get the macros.hlp file here: http://forum.designcad.com/index.php?topic=5.0

Although it is for version 17, basiccad hasn't changed much.

As for accessing block attributes, read up on the "query and change" parameters.

SY_INSERTIONPOINT
SY_NAME
SY_TYPE
SY_XSCALE
SY_YSCALE
SY_ZSCALE
SY_ATTDEFCOUNT
SY_ATTDEFTAG
SY_ATTDEFPROMPT
SY_ATTDEFVALUE
SY_ATTDEFCONSTANT
SY_ATTRIBUTECOUNT
SY_ATTRIBUTE

Now before you commit yourself to an ambitious coding effort, create a small sample of what you intend to do.  Both the OLE and BasicCad  peaked out on development effort several releases ago.  Not everything works 100% and blocks never earned my trust.  Take a guarded coding approach.

tectonic

Thanks again;

Will check out the references  :)