
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on a script to autogenerate schematics, and I'm having trouble getting tags from blocks to align properly. I see that the attributes (from GetAttributes) has a property called "TextAlignementPoint" which is a 3D array. I've successfully changed other attributes. But I can't change this particular one. I've tried both modifying each element of the array, and creating another array and copying that over to the attribute.
Other online examples seem to suggest this should. However, they are all referring to a "textObj". This may not qualify, though I would think it should.
Below is my subroutine. When the tag is found, it errors out: "Run-time error '-2145386494 (80200002)' Not applicable"
Anyone have any suggestions?
Private Sub alignTag(ByRef myBlock As AcadBlockReference, ByVal tagType As String, ByVal pd_x As Double, ByVal pd_y As Double)
Dim varAttribs As Variant
Dim n As Integer
Dim tagPoint(0 To 2) As Double
varAttribs = myBlock.GetAttributes
For n = LBound(varAttribs) To UBound(varAttribs)
If varAttribs(n).TagString = tagType Then
tagPoint(0) = pd_x
tagPoint(1) = pd_y
varAttribs(n).TextAlignmentPoint = tagPoint //this is the point that it errors out
End If
Next n
End Sub
Solved! Go to Solution.