• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

vba autocad mechanical

  • Thread starter Thread starter Lucacr88
  • Start date Start date

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.AmDetail.webpcreating 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?
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top