iLogic copy iProperties formula

iLogic copy iProperties formula

Anonymous
Not applicable
1,686 Views
4 Replies
Message 1 of 5

iLogic copy iProperties formula

Anonymous
Not applicable

Hi!

Did not find any answers to this one, but it should be easy?

 

I want to copy one iProperty to another, but I want to copy the formula, not the text.

 

This one copies only the text. i want to copy this: =<DimX> x <DimY> t=<DimZ>

 

SyntaxEditor Code Snippet

iProperties.Value("Custom", "Specification") = iProperties.Value("Custom", "SpecificationItem")

 /Nickolas

0 Likes
Accepted solutions (1)
1,687 Views
4 Replies
Replies (4)
Message 2 of 5

Balaji_07
Advocate
Advocate

Hi Nickolas,

 

Refer the below link for the answer..

 

http://modthemachine.typepad.com/my_weblog/2010/04/iproperty-expressions.html

 

Cheers 🙂

 

Thanks,

Balaji A

 

Accept this post as Solution if  you found it usefull and do not forget to hit Kudos! Smiley Wink

Message 3 of 5

Anonymous
Not applicable

Thanks:)

I have tried to use the examples in inventor iLogic, but with no success, im not that good at the API...

 

As in the picture, I want the expression (=<DimX> x <DimY> t=<Thickness>) to be copied, not the value (1757 x 230,7 t=1,5).

 

Untitled.jpg

btw, using Inventor 2014

0 Likes
Message 4 of 5

Balaji_07
Advocate
Advocate
Accepted solution

Hi Nickolas,

 

I have not noticed that you are using ilogic..

 

The below ilogic code snippet will work!

 

Use your iProperties, I have used some dummy iProperties(Specification, Specifications). NJoy 🙂

 

*********************************************************************

Sub Main()
Dim oCompDoc As Document
Dim oProp As String
Dim oPropSet As PropertySet
oCompDoc = ThisApplication.ActiveDocument

oPropSet = oCompDoc.PropertySets.Item("Inventor User Defined Properties")

iProp = oPropSet.Item("Specification").Expression

iProperties.Value("Custom", "Specifications") = iProp
End Sub

********************************************************************

 

Thanks,

Balaji A

 

Accept this post as Solution if  you found it usefull and do not forget to hit Kudos! Smiley Wink

 

Message 5 of 5

Anonymous
Not applicable
Whoho!
looks good, will test it on monday, right now the beer is more alluring then iLogic 😉
0 Likes