Dynamic Block Creation using ARX .NET

Dynamic Block Creation using ARX .NET

johnlwilliamsjr2013
Contributor Contributor
2,383 Views
10 Replies
Message 1 of 11

Dynamic Block Creation using ARX .NET

johnlwilliamsjr2013
Contributor
Contributor

Is it possible to create Dynamic Blocks using ARX .NET code or can this only be done using the Block Editor?  I would like to create a simple programmable rectangle using .NET code for starts.  I can do this with the Block Editor but would like to build complex blocks with code.

 

Thanks,

 

John W.

0 Likes
2,384 Views
10 Replies
Replies (10)
Message 2 of 11

tbrammer
Advisor
Advisor

First: This forum is for unmanaged ObjectARX. .NET questions should be posted to the .NET forum.

I think it is possible to create dynamic blocks programmatically - although I haven't done this yet.

I would recomment to use the ArxDbg.arx tool from <ARX>\samples\database\ARXDBG to analyze some dynamic blocks to find out which database objects are involved.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 3 of 11

Alexander.Rivilis
Mentor
Mentor

@tbrammer wrote:

...I think it is possible to create dynamic blocks programmatically - although I haven't done this yet...

No. It is impossible to create dynamic blocks with help of public ObjectARX SDK and with others API also. It is only possible to create AcDbBlockReference using manually created AcDbBlockTableRecord. Also you can copy with API AcDbBlockTableRecord from other dwg-file. 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 4 of 11

tbrammer
Advisor
Advisor

@Alexander.Rivilis wrote:

@tbrammer wrote:

...I think it is possible to create dynamic blocks programmatically - although I haven't done this yet...

No. It is impossible to create dynamic blocks with help of public ObjectARX SDK and with others API also. (...)


Are you sure? I analyzed a dynamic block with ArxDbg and found this:

 

dynamic.png

 

It looks to me as if the required APIs are exposed. What is missing?

(I still didn't really try to create a dynamic block from scratch)


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 5 of 11

Alexander.Rivilis
Mentor
Mentor

изображение.png

 

Try to find those classes within ObjectARX SDK. 😉 In order to create dynamic block you need description of such classes. It is for simplest dynamic block (attached).

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 6 of 11

tbrammer
Advisor
Advisor

*Sigh* - you're right, Alexander.

I didn't notice all the references under ACAD_ENHANCEDBLOCK.

They are also in my sample DWG.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 7 of 11

Alexander.Rivilis
Mentor
Mentor

Just in case, we can ask to clarify the answer to this question from @artc2  and @moogalm 

But I am at 99.9% sure that there is no public API to create dynamic blocks.

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 8 of 11

moogalm
Autodesk Support
Autodesk Support
Hi ,

Yes .. there is very limited API wrt to creation of Dynamic Blocks ..
Message 9 of 11

johnlwilliamsjr2013
Contributor
Contributor

Thanks for the feedback.  I will continue to investigate.  I feel that this capability is very important.

 

John W.

0 Likes
Message 10 of 11

johnlwilliamsjr2013
Contributor
Contributor

I am able to create the complex parameterized objects in code and add all of the distinct shapes into a single group object.  I created the code as a Lisp Function call, which allows me to pass in whatever parameters I need to, omitting the parameters I don't need for that particular object.
I am currently working on a form that allows the user to enter the object parameter information which will then call the code to create  the object.
After that, I will create the form that allows the user to change instance parameters of the selected object.

Fun stuff!

0 Likes
Message 11 of 11

Anonymous
Not applicable

Can I have a dome?

0 Likes