I asked this same question a few months ago, with the good help of some fellow forum users, this is how I got rid of it. See link below:
Also I edited this line in the code to round to the nearest half pound for my need using this:
iProperties.Value("Custom", "TotalWT") = (Round((mass*2.20462262)*2))
but you can set it to whatever result you want.
Good Luck, worked for me!
It looks that you have added the model physical property "Mass" in title block, but you do not want the unit of mass. Based on this requirement, please see the steps to accomplish -
1. Create one text custom property named "ModelMass"=0 in drawing document
2. Add this custom property in title block
3. Create one iLogic rule, and copy and paste the code lines below in rule
doc = ThisDrawing.ModelDocument
4. Run the rule, and you will get mass without unit in title block
5. Add this rule to "After Save Document" within event triggers. When saving the drawing document, the rule will run automatically. Please see the attached image.
I've had s similar issue come up where we have wanted to change the units callout to look differently.
What we have is "lbmass" What if we wanted "LB Mass" or just "LB". How would this be done?
The code I used was taken from the post I linked to, cwhetten gave it to me, but I have attached a screen shot of it in the VBA browser.
A few things that are required:
1-this is not an automatic rule, needs to triggered either manually or by setting up an event, event example I use, is when the document is saved the mass is updated.
2- this rule spits out a value with no units, for some reason it retrieves a value in KG by default so that is why there is small equation ((Round((mass*2.20462262)*2) to convert back to lbs. The unit display is a manual input see attached screen shot.
3- this rule only works when a base view of an actual model with mass is placed on the drawing triggered(saved). meaning if you only have a sketch or a view of a something that does not have a mass, then the rule will have an error. I get this all the time when I do a top view layout sketch using our drawing template.
Should work for ya!
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register