Lucacr88
Guest
hello to all
I have created a program with excel vba that allows me to automatically create drawings. use autocad mechanical 2010 and 2016.
I'm self-taught, I managed to do 90% of what I need by studying the vba object viewer and testing every entity and method. Unfortunately I got stuck on some elements that I just can't handle, especially I can't create a detail view of an element, I talk about the amdetail command, I attach photos for better understanding.
creating it manually I then listed by vba code the entities that exist, excluding lines and curves in this case, I get:
amdtdetailsym
amdtdetailsymlabel
acdbblockreference
I tried in every way through code to get the same result:
dim miodocument as acadmodelspace
dim detailsimbol as mcaddetailsymbol
dim labeldettagliosimbolo as mcaddetailsymbollabel
midocument = autocad.application.activedocument.modelspace
set detailsimbolo = mydocument. addcustomobject("amdtdetailsym")
set labeldetailsimbolo = mydocument .addcustomobject("amdtdetailsymlabel")
but I didn't even approach it, I create the entities and I can vary the properties with the methods but I can't create the "acdbblockreference" element and make it associated with a specific area of design... in other words nothing works.
I also tried the classic "plant the screw with the hammer" using:
autocad.application.activedocument.sendcommand "_amdetail"
but the execution stops as the window opens where the user has to confirm to proceed, I do not want this to happen since I might have to make dozens of views.
Can someone help me?
I have created a program with excel vba that allows me to automatically create drawings. use autocad mechanical 2010 and 2016.
I'm self-taught, I managed to do 90% of what I need by studying the vba object viewer and testing every entity and method. Unfortunately I got stuck on some elements that I just can't handle, especially I can't create a detail view of an element, I talk about the amdetail command, I attach photos for better understanding.
creating it manually I then listed by vba code the entities that exist, excluding lines and curves in this case, I get:amdtdetailsym
amdtdetailsymlabel
acdbblockreference
I tried in every way through code to get the same result:
dim miodocument as acadmodelspace
dim detailsimbol as mcaddetailsymbol
dim labeldettagliosimbolo as mcaddetailsymbollabel
midocument = autocad.application.activedocument.modelspace
set detailsimbolo = mydocument. addcustomobject("amdtdetailsym")
set labeldetailsimbolo = mydocument .addcustomobject("amdtdetailsymlabel")
but I didn't even approach it, I create the entities and I can vary the properties with the methods but I can't create the "acdbblockreference" element and make it associated with a specific area of design... in other words nothing works.
I also tried the classic "plant the screw with the hammer" using:
autocad.application.activedocument.sendcommand "_amdetail"
but the execution stops as the window opens where the user has to confirm to proceed, I do not want this to happen since I might have to make dozens of views.
Can someone help me?