Parameter Access

Parameter Access

amitnkukanur
Collaborator Collaborator
545 Views
2 Replies
Message 1 of 3

Parameter Access

amitnkukanur
Collaborator
Collaborator

How to access inventor assembly/Part parameters such as do,d1,d2,d3...... etc without going inside inventor.

I used apprentice server but i can display part names but parameters are not accessible.

 

Any Idead on how to do it

 

Senior Software Engineer
0 Likes
546 Views
2 Replies
Replies (2)
Message 2 of 3

jdkriek
Advisor
Advisor

That data is only available through Inventor.

 

Even if it were possible to extract the data without Inventor you would still need it to modify the data and recompute the part.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 3 of 3

amitnkukanur
Collaborator
Collaborator

Ok, then i will create a inventor instance and access, it this is the below code

 

 

 

Try

Try
oApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
Catch ex As Exception

End Try

If oApp Is Nothing Then
Dim InventorAppType As Type = System.Type.GetTypeFromProgID("Inventor.Application")
oApp = System.Activator.CreateInstance(InventorAppType)

oApp.Visible = False
bCloseInventorApp = True
End If

 

Dim SelectedItem As Object
Dim ThisApplication As Inventor.Application
ThisApplication = oApp.ActiveDocument

SelectedItem = oApp.Documents.ItemByName("D:\Rocker\test.ipt")
For Each OtherAParam As Parameter In SelectedItem.ComponentDefinition.Parameters
If (OtherAParam.Name = "d5") Then

Dim WeldMent As Double = 14.5 - 12

Dim ExistingVal As String = OtherAParam.Expression
ExistingVal = ExistingVal.Substring(0, ExistingVal.Length - 3)
Dim ExistingValToDouble As Double = Convert.ToDouble(ExistingVal)
WeldMent = WeldMent + ExistingValToDouble

Dim NewVal As String = Convert.ToString(WeldMent)
NewVal = NewVal + vbTab + "mm"
OtherAParam.Expression = NewVal

End If
Next

 

 

I am trying to do some calculations is it rite

Senior Software Engineer
0 Likes