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

edit dynamic block

  • Thread starter Thread starter piratabobo
  • Start date Start date

piratabobo

Guest
hello to all

I'm trying to create an automation that will lighten my work, but I can't ride "rain from the hole", I use autocad 2008 I have several dynamic blocks to insert into my design, all these different blocks have in common "the length" so as I insert them I have to type the length, at this point I thought something in vba that allows me to insert these blocks in my design and in automatic form to change the "longness solved"
I make an example of what I would like to do:
I have several dynamic blocks that have rectangular shapes where the length is variable, I insert these blocks into my design, depending on the type of block, I have to vary the length, and this is exactly what I wanted to automate change of length as the block I can insert but I can not edit in vba form the dynamic attribute of the block.
this is the code I use to insert the block
Code:
dim obkref as acadblockreference

center(0) = 1: center(1) = 1: center(2) = 0
set obkref = thisdrawing.modelspace.insertblock(center, "blocco", 1, 1, 1, 0)
Thanks in advance to anyone who can help me, and I hope I've been quite clear in exposing my problem.
 
hello to all

I'm trying to create an automation that will lighten my work, but I can't ride "rain from the hole", I use autocad 2008 I have several dynamic blocks to insert into my design, all these different blocks have in common "the length" so as I insert them I have to type the length, at this point I thought something in vba that allows me to insert these blocks in my design and in automatic form to change the "longness solved"
I make an example of what I would like to do:
I have several dynamic blocks that have rectangular shapes where the length is variable, I insert these blocks into my design, depending on the type of block, I have to vary the length, and this is exactly what I wanted to automate change of length as the block I can insert but I can not edit in vba form the dynamic attribute of the block.
this is the code I use to insert the block
Code:
dim obkref as acadblockreference

center(0) = 1: center(1) = 1: center(2) = 0
set obkref = thisdrawing.modelspace.insertblock(center, "blocco", 1, 1, 1, 0)
Thanks in advance to anyone who can help me, and I hope I've been quite clear in exposing my problem.
attached an example dwg file, from macro launches and selects an insert point, will be inserted the dynamic std block of autocad of the hexagonal nut. Once inserted will appear a window with the list of allowed values, select the value and will be inserted the block with here values.. .

very similar to what you have to do.

if you need more detailed explanations please ask.
 

Attachments

hi shape I tried to change the insertion of the dynamic block in this way:
Code:
'inserisce un blocco dinamico
p(0) = 1: p(1) = 1: p(2) = 0
set blocco = thisdrawing.modelspace.insertblock(p, "100-7", 1, 1, 1, 0)

variabile = blocco.getdynamicblockproperties

for i = lbound(variabile) to ubound(variabile)
    if variabile(i).propertyname = "lung" then
        variabile(i).value = lungh
    end if
    
    if variabile(i).propertyname = "larg1" then
        variabile(i).value = larg
    end if
    
next i

blocco.update
only that when I have to vary the length of the dynamic block, being this created with the ironing action is not stretched, I press that the stretching should be made to the left, while changing the action and pulling the block to the right works everything, but the problem is that I have the need to iron the block to the left.
is it possible to do this or do I have to iron right?
Thank you.
 
hi shape I tried to change the insertion of the dynamic block in this way:
Code:
'inserisce un blocco dinamico
p(0) = 1: p(1) = 1: p(2) = 0
set blocco = thisdrawing.modelspace.insertblock(p, "100-7", 1, 1, 1, 0)

variabile = blocco.getdynamicblockproperties

for i = lbound(variabile) to ubound(variabile)
    if variabile(i).propertyname = "lung" then
        variabile(i).value = lungh
    end if
    
    if variabile(i).propertyname = "larg1" then
        variabile(i).value = larg
    end if
    
next i

blocco.update
only that when I have to vary the length of the dynamic block, being this created with the ironing action is not stretched, I press that the stretching should be made to the left, while changing the action and pulling the block to the right works everything, but the problem is that I have the need to iron the block to the left.
is it possible to do this or do I have to iron right?
Thank you.
I said so I didn't understand much.... is it not that you can assist the request with the block dwg and the code in toto, so I understand better the problem?
 
thanks to the same shape I solved, the problem was in the fact that I inserted the parameter from left to right and then I tried to iron the block to left, I reversed the verse of the "linear parameter" from right to left and now I can safely and iron the block.
Thanks again
 

Forum statistics

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

Members online

No members online now.
Back
Top