- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I am having problem developing a piece of code for my drawing view where I can actively link my drawing view lets say "FRONT" view to one of the two positional representations I have in my main assembly model.
I have figured out a code to automatically change the pos reps of my assembly model using iLogic when certain parameter of my assembly is changed.
Now I also want my main drawing view which is "FRONT" view to check that same parameter using if statement and then activate the desired pos rep to reflect on the drawing. Thats the code I figured so far for my drawing but its not working, returning error "Unable to cast object of type 'Autodesk.iLogic.Runtime.CadDrawingView' to type 'Inventor.DrawingView'.
Thank you so very much for your help guys 🙂
Dim ViewF As DrawingView = ActiveSheet.View("FRONT") If GoExcel.CellValue("Sheet LXJ.xlsx", "Sheet1", "J23") = 1 ViewF.RepresentationsManager.SetPositionalRepresentation("1 LS", True) Else If GoExcel.CellValue("Sheet LXJ.xlsx", "Sheet1", "J23") = 2 ViewF.RepresentationsManager.SetPositionalRepresentation("2 LS", True) end if
Solved! Go to Solution.