Anonymous
569 Views, 3 Replies
03-29-2019
05:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-29-2019
05:30 AM
Hello
I want to use an Ilogic code to check if the drawing is created from a part, weldment or assembly document.
After that I will use different parts list styles depending of document type.
I can't find a code that works for it.
Solved! Go to Solution.
03-29-2019
06:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-29-2019
06:20 AM
Hello, try this rule in the drawing file
Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisDoc.Document Dim oSheet As Sheet oSheet = oDrawingDoc.ActiveSheet For Each oSheet In oDrawingDoc.Sheets oViews = oSheet.DrawingViews Dim oView As DrawingView For Each oView In oViews CentText = ThisApplication.TransientGeometry.CreatePoint2d(oView.Center.X , oView.Center.Y + oView.Height/2 + sFSize1*12) oView.Label.Position= CentText oView.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft oView.ShowLabel = True oViewModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument If oViewModelDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then oView.Label.FormattedText = "ASSEMBLY" If oViewModelDoc.SubType = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then oView.Label.FormattedText = "WELDMENT" If oViewModelDoc.SubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" Then oView.Label.FormattedText = "PART" If oViewModelDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then oView.Label.FormattedText = "SHEET METAL" Next Next
I hope it's useful
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
03-29-2019
07:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-29-2019
07:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-29-2019
07:40 AM
I am glad that the rule has served you, please mark my answer as a solution to the problem, thank you very much
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn