Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Properties

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
LOONYLEN
1222 Views, 7 Replies

Custom Properties

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...

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1
7 REPLIES 7
Message 2 of 8
thomaskennedy
in reply to: LOONYLEN

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

Message 3 of 8
LOONYLEN
in reply to: thomaskennedy

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

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1
Message 4 of 8
aparrow
in reply to: thomaskennedy

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"
--
Inventor 2012/2014 Certified Professional
Product/Factory Design Suite 2018
Vault Workgroup & Pro 2018
Dell T7610 - Dual Xeon @ 2.5GHz / 64GB Ram / ATI FirePro W7000 / 512GB SSD & Dual 1TB 10k RPM
Dell M7710 - Core i7 2.7GHz / 64GB Ram / AMD FirePro W5170M / Dual 512GB SSDs
Windows 10 64-bit
Message 5 of 8
Boorda
in reply to: LOONYLEN

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


Automation is key!
Message 6 of 8
aparrow
in reply to: Boorda

Excellent. 

 

Thank you!!

--
Inventor 2012/2014 Certified Professional
Product/Factory Design Suite 2018
Vault Workgroup & Pro 2018
Dell T7610 - Dual Xeon @ 2.5GHz / 64GB Ram / ATI FirePro W7000 / 512GB SSD & Dual 1TB 10k RPM
Dell M7710 - Core i7 2.7GHz / 64GB Ram / AMD FirePro W5170M / Dual 512GB SSDs
Windows 10 64-bit
Message 7 of 8
Boorda
in reply to: aparrow

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!
Message 8 of 8
LOONYLEN
in reply to: LOONYLEN

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

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1

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

Post to forums  

Autodesk Design & Make Report