iLogic iProperties.Value type set to text

iLogic iProperties.Value type set to text

Anonymous
Not applicable
1,825 Views
2 Replies
Message 1 of 3

iLogic iProperties.Value type set to text

Anonymous
Not applicable

Hello, I'm new to iLogic and I need to create a rule that will read some iProperties values and save them as custom properties, with assigned name and value converted to text.

It's because I later must export this model to IFC (using 3rd party software) and my properties set as number (not all of them), are displayed in IFC model with many more decimal places (different unit) than that showed in iProperties tab in Inventor.

I'm using Inventor 2015

 

Here is a preview of my code:

 

dl = Round(SheetMetal.FlatExtentsWidth,0)
szer = Round(SheetMetal.FlatExtentsLength,0)
gr = Round(Parameter("Grubo��"),0)
volume = iProperties.Volume



If dl<szer Then
wym = szer
ElseIf szer<=dl Then
wym = dl
End If


vol = volume/1000000000
powi = vol/(gr/1000)

iProperties.Value("Custom", "O40 Areal [m2]") = powi
iProperties.Value("Custom", "O41 Volum [m3]") = vol
iProperties.Value("Custom", "O42 Lengde [mm]") = wym
iProperties.Value("Custom", "O43 Tykkelse [mm]") = gr
iProperties.Value("Custom", "O44 Profil") = iProperties.Value("Project", "Stock Number")

 Parameters O40 and O41 are those in question. O42 and O43 are exported as needed.

 

I suppose that saving a value as text would solve the problem of this strange conversion during export.

 

Have a nice day

0 Likes
Accepted solutions (2)
1,826 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

I've found the solution by myself:) All I needed was to add 

CStr

in front of my property value.

So the code looks like this now (and does what was created for):

dl = Round(SheetMetal.FlatExtentsWidth,0)
szer = Round(SheetMetal.FlatExtentsLength,0)
gr = Round(Parameter("Grubo��"),0)
volume = iProperties.Volume



If dl<szer Then
wym = szer
ElseIf szer<=dl Then
wym = dl
End If


vol = volume/1000000000
powi = vol/(gr/1000)

iProperties.Value("Custom", "O40 Areal [m2]") = CStr(powi)
iProperties.Value("Custom", "O41 Volum [m3]") = CStr(vol)
iProperties.Value("Custom", "O42 Lengde [mm]") = CStr(wym)
iProperties.Value("Custom", "O43 Tykkelse [mm]") = CStr(gr)
iProperties.Value("Custom", "O44 Profil") = iProperties.Value("Project", "Stock Number")

 

 

0 Likes
Message 3 of 3

dutt.thakar
Collaborator
Collaborator
Accepted solution

@Anonymous 

 

You can also use

 

Parameter("powi").ToString

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn