02-21-2023
07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-21-2023
07:09 AM
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
(Not an Autodesk Employee)