Message 1 of 24
Changing Dynamic Block Visibility with a macro
Not applicable
10-17-2006
08:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'd like to modify the code below (posted by Allen Johnson on Dynamic Blocks Forum) so that instead of modifying the visibility of "cirtagleader" block, I could modify the visibility of all the blocks in my drawing that the name start with SYM-M.
Can any one help?
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
Thanks a lot,
Maxime Sanschagrin
I'd like to modify the code below (posted by Allen Johnson on Dynamic Blocks Forum) so that instead of modifying the visibility of "cirtagleader" block, I could modify the visibility of all the blocks in my drawing that the name start with SYM-M.
Can any one help?
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
Thanks a lot,
Maxime Sanschagrin