Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic Block

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
283 Views, 6 Replies

Dynamic Block

Please is there a way to load dynamic block parameters from an external file (ex. csv, mdb or others) and to automatically regenerate that block according to the new parameters?? is there a ready-for-use LISP script? or any API to download?
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

DBlock properties are available via ActiveX. There are several examples
posted in the Customization group.

--
R. Robert Bell


wrote in message news:5183363@discussion.autodesk.com...
Please is there a way to load dynamic block parameters from an external file
(ex. csv, mdb or others) and to automatically regenerate that block
according to the new parameters?? is there a ready-for-use LISP script? or
any API to download?
Message 3 of 7
Anonymous
in reply to: Anonymous

ok thanks a million... i've already had a brief look at it but i didn't find anything suitable .. please can anyone help me found a specific case regarding dynamic block parameter writing via DB? thanks a million
Message 4 of 7
Anonymous
in reply to: Anonymous

Option Explicit

Private Sub ScanBlks()
Dim dybprop As Variant, i As Integer
Dim bobj As AcadEntity
For Each bobj In ThisDrawing.ModelSpace
If bobj.ObjectName = "AcDbBlockReference" Then
If bobj.IsDynamicBlock Then
If bobj.EffectiveName = "cirtagleader" Then
dybprop = bobj.GetDynamicBlockProperties
For i = LBound(dybprop) To UBound(dybprop)
If dybprop(i).PropertyName = "Visibility" Then
dybprop(i).Value = "Leader Off"
End If
Next i
End If
End If
End If
Next

End Sub


The above example changes the "Visibility" visibility state of a block "cirtagleader" to "Leader Off" for each insert in the
drawing.
Message 5 of 7
Anonymous
in reply to: Anonymous

Hi Allen,

I'd like to know if there is a way to use wildcard in your code? I tried to replace the " If bobj.EffectiveName = "cirtagleader" Then " with " If bobj.EffectiveName = "SYM-M*" Then " so that all my blocks starting with SYM-M in my drawings are modified.

Thanks for your time.

Maxime Sanschagrin
Message 6 of 7
Randy Pohle
in reply to: Anonymous

Since the code checks every block in the drawing, change the line:

If bobj.EffectiveName = "cirtagleader" Then

to:

If left(bobj.EffectiveName,5) = "SYM-M" Then

and that will act like your wild card "SYM-M*"
Message 7 of 7
Anonymous
in reply to: Anonymous

It doesn't seem to work Randy. Instead, someone on the VBA forums posted this code that works great:
Replace:
'If bobj.EffectiveName = "cirtagleader" Then

By:
If bobj.EffectiveName Like "SYM-M*" Then

Thanks for taking the time to answer.

Maxime

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services