Jump to content

BOM problem in Mechanical


swestbrook60

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...