dynamic blocks programming

dynamic blocks programming

Anonymous
Not applicable
3,219 Views
4 Replies
Message 1 of 5

dynamic blocks programming

Anonymous
Not applicable

dynamic blocks programming
I would like to use dynamic blocks in my code.
Which technology to use (VBA, .NET Api (c# or vb.net, objectARX) ?
I am new to dynamic blocks.
Where I can get any information about programming dynamic block ?
Are there any ebook or help. I couldn't find much about it.
I write code in vba, but I may learn new better technology.
It will be 2D drawing, reinforcement bar with additional data as a dynamic blocks.

Thank You in advance

Accepted solutions (1)
3,220 Views
4 Replies
Replies (4)
Message 2 of 5

norman.yuan
Mentor
Mentor
Accepted solution

It depends on what do you mean by "programming" in terms of dynamic block.

 

If you want to use code to create/compose a block definition with various dynamic properties, you are out of luck: there is no API exposed to programmatically create a dynamic block definition (a block definition plus dynamic properties. That is, you can use code to create a block definition, but you cannot use code to define dynamic properties).

 

On the other hand, you can manipulate dynamic properties of a dynamic block reference (the blocks you actually see in drawing) with COM API (VBA) or .NET API.

 

So, if you want to "program" dynamic blocks, it would mean that you (or someone else) first create the needed dynamic blocks based on the business requirements, then the block with dynamic proiperties can be inserted into drawing manually, or progammatically, and then your code can identify the block references and manipulate its dynamic properties accordingly.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5

Anonymous
Not applicable

Thank you for quick reply.

Your explanation is very good.

I quote:

It depends on what do you mean by "programming" in terms of dynamic block.

"Programming" I mean: writing a code which does specific operations.

 

So as You wrote I manually/by hand create block with dynamic properties,

then I use code (vba, c# etc.) to put it into model space and manipulate its dynamic properties accordingly.

 

I would like to choose proper programming language/ technology to:

 - manipulate properties of dynamic blocks.

I take into consideration: COM VBA ; .NET C#, objectARX c++.

Are these technology ( COM VBA ; .NET C#, objectARX c++. ) equal in:  manipulate properties of dynamic blocks ?

Or some of them have restrictions and other use full capability ?

 

 

 

 

0 Likes
Message 4 of 5

norman.yuan
Mentor
Mentor

In terms of reading/writing block refernce's dynamic properties, there is not much difference between COM API (VBA) or .NET API (C#/VB.NET), do not know about ObjectARX C++.

 

However, your app/tool would deal other AutoCAD functionalities naturally, in order to actually manipulate dynamic blocks. And very ooften than not, once you started, your app would start rolling like snow ball. 

 

Therefore, using AutoCAD .NET API is better choice than using VBA, unless you are sure the app would be a small/quick solution. ObjectARX C++ is meant for professional/commercial AutoCAD custom application usually.

 

Whatever API/technology you choose, all require decent understanding how AutoCAD works.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 5

Anonymous
Not applicable

Thank you very much for your help.

0 Likes