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