Please see the attached video and code sample and note the different results.
The correct result is what 2024 outputs, 2025 seems to be ignoring the line to set the display to wireframe???
Can someone help me understand why the 2 version provide different results when running the same code?
@johnsonshiue or @MjDeck can you confirm that this is not working as expected, or point out why we'd get 2 different results?
We have a customer needing this functionality and we need to find some other solution is this is indeed a bug, but I thought/hoped maybe I was misunderstanding something???
Dim m_Doc = ThisApplication.ActiveEditDocument oFolder = "C:\Temp\Part Preview\" Dim oFileName = oFolder & "Thumb Nail Pic.jpg" Dim m_Camera As Inventor.Camera m_Camera = ThisApplication.TransientObjects.CreateCamera() m_Camera = ThisApplication.TransientObjects.CreateCamera() If m_Doc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then m_Camera.SceneObject = DirectCast(m_Doc, PartDocument).ComponentDefinition Else m_Camera.SceneObject = DirectCast(m_Doc, AssemblyDocument).ComponentDefinition End If 'get current settings m_Disp3D = ThisApplication.DisplayOptions.Show3DIndicator m_PrevMode = ThisApplication.DisplayOptions.NewWindowDisplayMode ThisApplication.DisplayOptions.NewWindowDisplayMode = DisplayModeEnum.kWireframeNoHiddenEdges ThisApplication.DisplayOptions.Show3DIndicator = False m_Camera.Perspective = False m_Camera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation m_Camera.Perspective = False m_Camera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation m_Camera.Fit() m_Camera.ApplyWithoutTransition() Try m_Camera.SaveAsBitmap(oFileName, 600, 600, ThisApplication.TransientObjects.CreateColor(255, 255, 255)) Catch ex As Exception MsgBox(ex.Message) Finally 'reset options ThisApplication.DisplayOptions.NewWindowDisplayMode = m_PrevMode End Try
Forum links: Inventor iLogic , API and Customization Forum | Inventor Ideas Forum | General Inventor Forum
Migrate Inventor Add-ins to 2025 .Net ( from .Net Framework)
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
Hi Curtis - so far I haven't been able to get the rule to produce a wireframe image on Inventor 2024.
Which exact version of 2024 are you running? Have you tried it on another machine?
I'm not sure if the Camera is supposed to follow the display settings for new windows. After all, it's not a window. I'm looking into it.
Maybe you could use a View instead of a Camera?
Thanks Mike!
This testing has mostly just been on this one machine, as far as 2025. But I've had others run this routine with 2023 and 2024, with the wireframe results working as expected.
I was running version 2024.2 build 272, but just installed update 3 and I see the same results with 2024.3 build 343. Meaning that I get the wireframe thumbnail as expected with update 3.
I'll rewrite this with View and see what I get, and post back.
Thanks again!
Update: using view rather than camera for the display mode/ wire frame setting did indeed resolve this.
Dim oFileName = "C:\Temp\Thumb Nail Pic.jpg"
Dim oView As Inventor.View = ThisApplication.ActiveView
Dim oCamera As Inventor.Camera
oCamera = oView.Camera
Dim oCurrentDisplayMode As DisplayModeEnum = oView.DisplayMode
Dim oCurrentViewOrientation As ViewOrientationTypeEnum = oCamera.ViewOrientationType
ThisApplication.ScreenUpdating = False
ThisApplication.DisplayOptions.Show3DIndicator = False
oView.DisplayMode = DisplayModeEnum.kWireframeNoHiddenEdges
oCamera.Perspective = False
oCamera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation
oCamera.Fit()
oCamera.ApplyWithoutTransition()
Try
oCamera.SaveAsBitmap(oFileName, 600, 600, ThisApplication.TransientObjects.CreateColor(255, 255, 255))
Catch ex As Exception
MsgBox(ex.Message)
Finally
oCamera.ViewOrientationType = oCurrentViewOrientation
oCamera.ApplyWithoutTransition()
ThisApplication.ActiveView.DisplayMode = oCurrentDisplayMode
ThisApplication.DisplayOptions.Show3DIndicator = True
ThisApplication.ScreenUpdating = True
ThisApplication.ActiveView.Update()
End Try
Can't find what you're looking for? Ask the community or share your knowledge.