Custom Properties

Custom Properties

Anonymous
Not applicable
1,465 Views
7 Replies
Message 1 of 8

Custom Properties

Anonymous
Not applicable

Has anyone figured out how to import "Mass" into custom properties and then remove the "lbmass" and add "lbs" either through a parameter equation, vba, or Ilogic?

 

I know there is an "isolate" function, but I don't know the rest of the string.

 

Also, I'm having trouble with my Ipart members keeping my custom material. The correct color is showing around the edges of the parts, but not the surfaces. This is probably a checkbox that I'm missing somewhere.

 

I wish Inventor would just add some of these lifelong problems to the software and throw us a bone...

0 Likes
Accepted solutions (1)
1,466 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Setting up a custom iProp called "mass" and running this in iLogic :

 

iProperties.Value("Custom", "mass") = iProperties.Mass & "lbs"

Results in the mass with "lbs" concatenated onto the end.

 

Is this what you are trying to achieve?

 

Tom

0 Likes
Message 3 of 8

Anonymous
Not applicable

Thanks for your reply.

 

Yes that is what I was looking for, but I'm looking to do it in the parameter equation box.

 

The old way to do it was isolate(Mass;lbmass;ul) - which, if written in a "UL" parameter would give you the same answer as your Mass property without the "lbmass", then you could send that to your .idw "Weight" box and on the template add "Lbs.", it would update and was connected to the part or assembly. It was a REAL weight value.

 

I was wondering if there was a way to round the answer to one place (X.X Lbs.) and add the Lbs. tag all in the parameters box.

 

Or maybe in the VBE and embed it in that file. I kind of want to stay away from the "Ilogic" thing on this project.

 

Thanks,

 

Len

0 Likes
Message 4 of 8

Anonymous
Not applicable

Pretty old post. But how would I limit the mass to say 3 or 4 decimal places? I get about 20 places when using the below code.

 

Thanks!

 

iProperties.Value("Custom", "mass") = iProperties.Mass & " lbs"
0 Likes
Message 5 of 8

Boorda
Advocate
Advocate

iProperties.Value("Custom", "mass") = Round(iProperties.Mass,4) & " lbs"


Automation is key!
Message 6 of 8

Anonymous
Not applicable

Excellent. 

 

Thank you!!

0 Likes
Message 7 of 8

Boorda
Advocate
Advocate
Quick rule of thumb is to remember that iLogic is basically a script library that sits on top of VBA. So if you cant find information on something iLogic specific most of the time you can look for VBA examples and try to apply then in the iLogic code. If fact you can run VBA code in iLogic its self.

Automation is key!
0 Likes
Message 8 of 8

Anonymous
Not applicable
Accepted solution

Hello,

 

The answer I was looking for to import Mass into a custom iProperty and then remove the "lbmass" and add "lbs" using only parameters is as follows:

 

  1. Create a custom iProperty called "Mass" and use the "lbmass" unit type.
  2. Create a custom iProperty called "CalcWt" and use the "ul" unit type.
  3. In the "CalcWt" custom iProperty type "isolate(Mass;lbmass;ul)". This takes the "Mass" property value, changes it to unitless AND removes the "ul" from the value.
  4. You can now attach the "CalcWt" iProperty to a value on your .idw title block in the "Weight" section (using the text editor). You can also add "lbs." after the "CalcWt" iProperty in the text editor to append the "lbs." to the value on the .idw.
  5. You can also add iLogic code in a rule to update the "Mass" custom iProperty from the actual Mass of the part or assembly. This is the iLogic code for the Mass update:

InventorVb.DocumentUpdate()

iLogicVb.UpdateWhenDone = True
Mass = iProperties.Mass

0 Likes