iLogic rule

iLogic rule

Dopey1993
Enthusiast Enthusiast
427 Views
2 Replies
Message 1 of 3

iLogic rule

Dopey1993
Enthusiast
Enthusiast

THIS RULE WORK WELL ON A IAM FILE HOW DO I GET IT TO WORK ON A IPT FILE

 

 

 

 

 

 

SyntaxEditor Code Snippet

Sub Main
    If TypeOf ThisDoc.Document Is DrawingDocument Then
        Dim dwgDoc as DrawingDocument = ThisDoc.Document
        For Each dwgSheet As Sheet In dwgDoc.Sheets
            If dwgSheet.DrawingViews.Count > 0 Then
                modelFile = dwgSheet.DrawingViews(1).ReferencedDocumentDescriptor.FullDocumentName
                modelDoc = dwgSheet.DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument
                prtNumber = modelDoc.PropertySets("Design Tracking Properties").Item("Part Number").Value & " - " & _
                    modelDoc.PropertySets("Design Tracking Properties").Item("Description").Value
                If Not String.IsNullOrEmpty(prtNumber) Then
                    dwgSheet.Name = prtNumber
                End If
            End If
        Next
    End If
End Sub

  

0 Likes
428 Views
2 Replies
Replies (2)
Message 2 of 3

Mark.Lancaster
Consultant
Consultant

I'm confused...   You rule looks like it runs on a drawing not an Inventor assembly.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 3

Dopey1993
Enthusiast
Enthusiast

YES I HAVE THE RULE WRITTEN IN A IDW FILE 

 

IT WILL READ THE PART NUMBER AND DESCRIPTION OF A IAM FILE BUT NOT A IPT FILE 

0 Likes