swestbrook60 Posted September 28, 2008 Share Posted September 28, 2008 In building an applicqtion that automatically generates a drawing I have come across a problem. After attaching the balloons (AcmBalloon) and specifying a new text height for the balloon text based on the ViewPort scale to be used in PaperSpace, the BOM PartsList also changes its text height to the same text height that is being used in ModelSpace. When I tried to use the following VBA code to modify the BOM PartsList text height and heading height values back to 3.5 mm I found that these API values are read-only. Why? They can later be changed manually, but I cannot find a way to do it automatically. Dim obj As AcadObject Dim oPref As McadPartReference Dim std As McadStandard Set obj = ThisDrawing.ModelSpace.AddCustomObject("AcmPartRef") Set std = pRref.Standard std.BOMStandard.PartsListStandard.ActualRowTextHeight = 3.5 std.BOMStandard.PartsListStandard.Headingheight = 3.5 These last two lines result in an error since the values are read-only. Does anybosy know how I can set these values? Thanks. Quote Link to comment Share on other sites More sharing options...
swestbrook60 Posted September 30, 2008 Author Share Posted September 30, 2008 For anyone interested I have found my own solution. Apparently when you are adding a PartsRef to a drawing it resets the text height of the PartsList to be the same, so I made the Balloon TextHeight the appropriate size for the PartsList, then I looped back through the balloons and revised the TextHeight property for them to be the appropriate size. Modifying the balloons does not affect the PartsList. At least in AutoCad Mechanical 8, you can define the TextHeight of the Heading but not of the data rows, the fields that control the data rows are read-only. Also be aware if you are ever dealing with these properties, if you change the text height you will find the text color also changes and you will have to reset this field as well. Quote Link to comment Share on other sites More sharing options...
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.