ollie Posted February 24, 2009 Posted February 24, 2009 Hey folks i wrote my first cva autocad script today and was wondering if you's could pass on any advice: the script creates new attdefs that are replicas of old block attributes: Sub Block_edit() Dim objCount As Integer Dim mspaceObj As AcadObject Dim att As AcadAttributeReference Dim block As AcadBlockReference Dim i As Integer objCount = ActiveDocument.ModelSpace.Count For i = 0 To objCount - 1 Set mspaceObj = ThisDrawing.ModelSpace.Item(i) If mspaceObj.ObjectName = "AcDbBlockReference" Then Set block = mspaceObj retval = block.GetAttributes() For Each c In retval Set att = c Set new_att = ThisDrawing.ModelSpace.AddAttribute(att.Height, acAttributeModeNormal, "", att.InsertionPoint, att.TagString, att.TextString) Next c End If Next End Sub It works fine but i don't know how to create a selection set or collection of these items so i can turn them into a block later on. Any suggestions would be great Thannks Ollie. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.