Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it possible to retrieve the View representations( View,Position & LOD) used as a parameter/text and print on idw?
Solved! Go to Solution.
Is it possible to retrieve the View representations( View,Position & LOD) used as a parameter/text and print on idw?
Solved! Go to Solution.
To retrieve that data use the properties from the DrawingView class:
ActivePositionalRepresentation
ActivePresentationView
ActiveLevelOfDetailRepresentation / ActiveModelState
If you want to add them in the drawing you can create general notes after reading that values, check this post and look at the sample: https://forums.autodesk.com/t5/inventor-forum/create-text-box-in-drawing-using-ilogic/m-p/5094780#M5...
Thanks-making progress- can retrieve View name, View Position & View LOD but not the View Representation?
Any reason why?
Code to date
Dim oView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View") If oView Is Nothing Then Exit Sub bView = oView.Name Dim oModelDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument Dim oViewRep As String oViewRep = oView.ActivePresentationView Dim oViewPos As String oviewPos = oView.ActivePositionalRepresentation Dim oViewLOD As String oViewLOD = oView.ActiveLevelOfDetailRepresentation MessageBox.Show(bView, "View Name") MessageBox.Show(oViewRep, "View Details") MessageBox.Show(oViewPos, "View Position") MessageBox.Show(oViewLOD, "View LOD")
Thanks in advance
PJ
You had the incorrect property active this line should be as below.
oViewRep = oView.ActiveDesignViewRepresentation
For some reason this is missing in the online documentation DrawingView @CattabianiI had kindly posted. You can find this in the drop down in the editor or in the built in API help.
Thanks- added the line of code via copy/paste (Can't get the dropdown menu to appear) but still no result in message box. Also trying to find a snippet or command that returns the co-ordinates of the selected view to enable printing of the view data in relation to the view position- can you help thanks
Check this forum topic "DrawingView->ActivePresentationView never returns value". It seems to be a bug.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
Is the view set to associative in the drawing? If not the view is a snapshot of the model design view and not linked. I would place in an error catch statement to say not associative if returned blank as this is an important part of updating the views.
Here is a quick one to get the position and here is how to move a label in relation to the view.