Autodesk Inventor Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Ilogic View Reps on dwg
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
HI
I am after help on some ilogic code ,I have had some code done to isolate selected parts in a assembly file that has a specific custom property filled in i.e. : DESC2.It then creates view reps and locks down giving the rep name the same name as part.
What I am after if any one can help is some code that will place these isolated view reps as views on my dwg that the assembly resides in.With the functionality of picking face to show plan view of parts.
Any thoughts would be appreciated.
Dave
Re: Ilogic View Reps on dwg
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
If I understand correctly, you want to place the drawing views from one assembly in specific view reps (or even specific LOD etc) like UI does (see attachment). If yes, you could use Advanced API of ilogic to access Inventor API. DrawingViews.AddBaseView allows you to specify additional or advanced options:
|
Name
|
Value Type
|
|
|
WeldmentFeatureGroup
|
Weldment
|
|
|
SheetMetalFoldedModel
|
Boolean
|
Sheet Metal
|
|
String
|
Part, Assembly
|
|
|
DesignViewAssociative
|
Boolean
|
Part, Assembly
|
|
String
|
Assembly
|
|
|
MemberName
|
String
|
Part, Assembly
|
|
PresentationView
|
String
|
Presentation
|
|
PresentationViewAssociative
|
Boolean
|
Presentation
|
Following is a demo code I converted from the sample in the help reference of Inventor API:
' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the active sheet. Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet ' Create a new NameValueMap object Dim oBaseViewOptions As NameValueMap oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Set the representations to use when creating the base view. 'Call oBaseViewOptions.Add("PositionalRepresentation", "MyPositionalRep") Call oBaseViewOptions.Add("DesignViewRepresentation", "Default") 'Call oBaseViewOptions.Add("DesignViewAssociative", True) ' Open the model document (corresponding to the "MyLODRep" representation). Dim strFullDocumentName As String strFullDocumentName = ThisApplication.FileManager.GetFullDocumentName("c :\temp\reps.iam", "Master") Dim oModel As Document oModel = ThisApplication.Documents.Open(strFullDocumentName , False) ' Create the placement point object. Dim oPoint As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(25 , 25) ' Create a base view. Dim oBaseView As DrawingView oBaseView = oSheet.DrawingViews.AddBaseView(oModel, oPoint, 2, _ kIsoTopLeftViewOrientation, kHiddenLineRemovedDrawingViewStyle, _ , , oBaseViewOptions)
Xiaodong Liang
Developer Technical Services
Autodesk Developer Network
