how do I get the partnumber form the select file ?

how do I get the partnumber form the select file ?

Darkforce_the_ilogic_guy
Advisor Advisor
481 Views
1 Reply
Message 1 of 2

how do I get the partnumber form the select file ?

Darkforce_the_ilogic_guy
Advisor
Advisor

I want to open an file call the "partnumber".pdf ... why does i not get the partnumber form the select part ?

 

Sub Assambly()
	
	Dim partnumber 
	 
'ask you to select spareparts
	Dim oRefDoc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select FG component")
setBL(oPart)

End Sub 


Sub setBL(oOcc As ComponentOccurrence)
	Try
		MessageBox.Show(iProperties.Value(oOcc.Name, "Project", "Part Number") , "Title")



		partnumber = iProperties.Value(oOcc.Name, "Project", "Part Number") 
		MessageBox.Show(partnumber.ToString, "Title")
		InventorVb.DocumentUpdate()
	Catch

		'iLogicVb.RunExternalRule("EditLengthOfOldTypeProfile")

	End Try
	
	InventorVb.DocumentUpdate()
	ThisDoc.Launch("\\srv\Prodtegn\_BC365 Varekokumenter\" & partnumber & ".pdf")
End Sub
0 Likes
Accepted solutions (1)
482 Views
1 Reply
Reply (1)
Message 2 of 2

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Darkforce_the_ilogic_guy 

Have another look at your code. The variable storing the occurrence is called "oRefDoc", not "oPart".