Parameter Value / Units

Parameter Value / Units

Anonymous
Not applicable
3,423 Views
5 Replies
Message 1 of 6

Parameter Value / Units

Anonymous
Not applicable

Hello Everybody,

My question concerns Parameters value. I have a drawing document with some rules, and in this document I placed different models. The unit of these models can be either "mm" or "inch", and also one model can change its units from "mm" to "inch". 

I am trying to get some parameter value of these models. Is there a way to get the value in one single unit for all models no matter what the model units are ?
For example, If the model units are in "mm" I want to get the value in "cm" and if the model units are in "inch" I want also to get the value in "cm".

Any help ?

Thanks in advance

0 Likes
Accepted solutions (1)
3,424 Views
5 Replies
Replies (5)
Message 2 of 6

JhoelForshav
Mentor
Mentor

Hi @Anonymous 

Can you describe in more detail how you obtain these parameters?

The Inventor.Parameter objects property Value will always be in database units (cm) no matter the documents units.

If you use the iLogic function Parameter.Value(docAndParamName As String) it will convert it however to the documents units however...

 

Message 3 of 6

Anonymous
Not applicable

Hi @JhoelForshav,

 

 yes indeed i am using  iLogic function Parameter.Value(docAndParamName As String) to get values.
Could you advise about the other method ?

Thanks

0 Likes
Message 4 of 6

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Anonymous 

You can get the Parameter object with iLogic function Parameter.Param

So in your case you should be able to just do this change:

'Change
Parameter.Value("docAndParamName")
'To
Parameter.Param("docAndParamName").Value

Then you'll get the value in cm units allways 🙂

Message 5 of 6

Anonymous
Not applicable

Thank you @JhoelForshav 

0 Likes
Message 6 of 6

Rsilvers23
Contributor
Contributor

I'm having an issue with the coding to do this...

I'm using iLogic to go thru an assembly and open any parts that match the keyword and then export them as Iges

Once the file opens, I want to get the parameters to use to set the file name.

Every time it gets to the parameter code it closes the open file and goes to the next component.

The excess messages is so I can track down where it stops.

Here is part of the code... Any help would be great!

 

Try
Dim sIGSname As String Dim Ga As String Dim TubeSize As String Dim TubeGA As Stringo
Part
= oRefDoc
oPartName = oRefDoc.PropertySets.Item(3).Item("Stock Number").Value
oProjNo = oRefDoc.PropertySets.Item(3).Item("Project").Value
Fname = oProjNo
'Get parameter info for each tubing shape
Dim TubeShape As String
If oTubeStyle = "TUBELASER-OD"
MessageBox.Show("Code Check Point 3", "CP3")
TubeSize = Parameter.Param(oRefDoc, "TOD").Value
MessageBox.Show(TubeSize, "TubeSize")
TubeGA = Parameter.Param(oRefDoc, "TThk").Value
MessageBox.Show(TubeGA, "TubeGa")

ElseIf oTubeStyle = "TUBELASER-SQ"
MessageBox.Show("Code Check Point 4", "CP4")
TubeSize = Parameter.Param("TSH")
MessageBox.Show(TubeSize, "TubeSize")
TubeGA = Parameter.Param("TThk")
MessageBox.Show(TubeGA, "TubeGa")

ElseIf oTubeStyle = "TUBELASER-RECT"
MessageBox.Show("Code Check Point 5", "CP5")
TubeSizeW = Parameter.Param(oRefDoc, "TRH").Value
TubeSizeH = Parameter.Param(oRefDoc, "TRW").Value
MessageBox.Show(TubeSize, "TubeSize")
TubeGA = Parameter.Param(oRefDoc, "TThk").Value
MessageBox.Show(TubeGA, "TubeGa")

End If

 

0 Likes