Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to remove iproperty mass unit string from Mass value in a text string...

9 REPLIES 9
Reply
Message 1 of 10
knowga
5059 Views, 9 Replies

How to remove iproperty mass unit string from Mass value in a text string...

I've been looking for a solution to remove the unit string ie Lbs, g, kg from the value given from a 'Mass' value in a text string.

 

As you may all know, creating text and having a 'physical property - mass' value...the unit string is there...

Lots of people on here have the problem...no-one has got a solution.

 

Until now...

 

Basically...open the part you need to get the mass property of in your text string.

 

Follow the instructions on this webpage...this is the first part...

 

http://inventorbetter.blogspot.com/2010/10/customizing-iproperties-in-inventor.html

 

Basically, this creates a Mass property value in the parameters table that you can call on as a text parameter.

It's similar to the custom iproperty model - mass but NOT the same.

 

Once you have done this, you can go to the drawing of the part and create a text string in the drawing and call it up as shown in this procedure. BUT it still has the unit string.

 

Here's the best bit that you want to know...

To get RID of the unit string...open up the part again from the drawing...click on the parameter icon...find the user parameter...in the Nominal value column, right click on the value and you get a pop-up that gives you 3 options...

Custom Property Format, Make Multi Value & Delete Parameter.

Click on Custom Property Format.

The pop-up window comes up...showing you the property type...in my case...the 4 left columns read Text, g (grams), Format & Precision...

On the right hand side I have a Preview of the text...then 3 check boxes...Units string, Leading Zero's, Trailing Zero's.

Units string is checked.

Uncheck it.

Close it...Save your part...go back to the drawing and hey presto!...the text now shows the weight you require as a straight value...no units!

 

Hope this helps you all

 

Gary

 

9 REPLIES 9
Message 2 of 10
MarkDooley
in reply to: knowga

The link you posted to look at for set up has been removed.  Do you have another link or the text instructions that go with the link??

Message 3 of 10
JimStrenk
in reply to: MarkDooley

Try this link:

 

http://blogs.rand.com/manufacturing/2011/07/inventor-ilogic-mass-to-custom-iproperties.html

 

I think that's what you're looking for.

Jim Strenk

Inventor 2012 Certified Associate
AutoCAD 2012 Certified Associate

Product Design Suite Ultimate 2012, 2013, 2014, 2015,2016, 2017

Other than THAT, Mrs. Lincoln, how was the play??
Message 4 of 10
akhidrosyidi
in reply to: JimStrenk

hi jim,
can you help me how to dellete existing custom properties?
i only can add, or change the value. but cannot delete or renaming the custom property.

Message 5 of 10
GDERBYSHIRE
in reply to: knowga

the instruction  link on this page is broken....can you provide a redirect or a new link....

 

http://inventorbetter.blogspot.com/2010/10/customizing-iproperties-in-inventor.html

 

above link no longer works.....cant get there from here....

 

Glenn

Message 6 of 10
dan_inv09
in reply to: JimStrenk

That's creating a Custom iProperty directly, the other one seemed to promise creating a parameter linked to the mass iProperty.

Message 7 of 10
dan_inv09
in reply to: GDERBYSHIRE

This seems broken as well.

Message 8 of 10
LT.Rusty
in reply to: dan_inv09

To create a paramter based on iProperties.Mass, you need this little snippet of iLogic:

 

Format:HTML Format Version:1.0 StartHTML:     165 EndHTML:     955 StartFragment:     314 EndFragment:     923 StartSelection:     314 EndSelection:     314
SyntaxEditor Code Snippet

Parameter("partmass")=iProperties.Mass

 

I add an update before and after, so my code looks like this:

 

Format:HTML Format Version:1.0 StartHTML:     165 EndHTML:    1497 StartFragment:     314 EndFragment:    1465 StartSelection:     314 EndSelection:     314
SyntaxEditor Code Snippet

InventorVb.DocumentUpdate()
Parameter("partmass")=iProperties.Mass
InventorVb.DocumentUpdate()

This rule is set to run before save on each part and assembly.

 

I've created a parameter in my part and assembly templates called "partmass."  The units for this are set to "lbmass," and the key / export boxes are checked.  In the custom property format window, I set propety type to TEXT, and uncheck UNITS STRING, and set the precision to whatever is needed.

The parameter stuff that we did - marking for export, etc - will create a custom iProperty called "partmass."  I now create a second custom iProperty called WEIGHT, whose value is set to "=<partmass> LBS" (minus quotes).

 

Now, every time I save the file, the iLogic code updates the parameter, which updates the iProprties.

 

This stuff is embedded in my templates, so I don't have to mess with it unless I'm opening up parts that are older than the current template version.

 

 

Rusty

EESignature

Message 9 of 10
GDERBYSHIRE
in reply to: LT.Rusty

Thanks LT Rusty

 

Message 10 of 10
knowga
in reply to: GDERBYSHIRE

Hello Going back to this topic, I'm currently using Inventor 2013 that i began, I found another simple way of getting mass displayed on a drawing, as text, with no unit string. Create a part and create a drawing for that part. Open the part. Go to the iProperties for the file and click on the Custom tab. Click on Name, create a parameter, I called mine massnounits. Set the type to Number Add it. It appears on the list underneath with a value of zero. Close the iproperties window. Go to the manage tab. Click on add rule I just take the first one, Rule0 The Edit Rule:Rule0 window comes up. Type in the window... iProperties.Value("Custom", "massnounits")=Round(iProperties.Mass) then OK the rule Close the part to return back to the drawing Start a text string by clicking "A" text Click on the drawing to enter the text in the text window click on the down arrow for "Type" and select "Custom Properties - Model" You should see your custom iproperty appear, in my case, massnounits click on the add text parameter arrow to add it to your text window. OK the text window to exit it. And, if like mine, the text you added will show the totalmass as a number. this should just about close this topic out. cheers...gimme some feedback if my usually "Homer"-like tendencies were absent and it works for you all. Regards Gary

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report