Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: op_thorsager

Yes.  That perfectly cleared up the parameters related questions.  Since this code appears to be for an 'internal' iLogic rule, and it appears to be stored within the part's DrawingDocument, I assume then that there would only be one model reference in that whole drawing...just that one part, right?  If so, then there would not be any need to activate any specific sheet(s), and no need for more than the one 'Main' routine.  Assuming that the "PartLocation" parameter is 'local' (within the DrawingDocument), in which case it would usually turn blue.

 

Sub Main
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim partpath As String = ThisDoc.ModelDocument.ComponentDefinition.Parameters.Item("Location").Value
	PartLocation = partpath & "\3D\"
	Dim viewModelDoc As String = PartLocation & "Cloth.ipt"
	Dim oFD As FileDescriptor = oDDoc.ReferencedDocumentDescriptors.Item(1).ReferencedFileDescriptor
	oFD.ReplaceReference(viewModelDoc)
	oDDoc.Update()
End Sub

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)