Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic - Make drawing view shaded.

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
waynehelley
2096 Views, 9 Replies

Ilogic - Make drawing view shaded.

Is there a line of code that will look at a drawing view and turn shading on?

 

I have tried

 

ActiveSheet.View("VIEW1").View.Shaded = True

but it didn't work Smiley Sad

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
9 REPLIES 9
Message 2 of 10
VdVeek
in reply to: waynehelley

There was an older post here: http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/iLogic-code-for-Visual-styles-Shaded-w...

Hope that helps you.

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 3 of 10
waynehelley
in reply to: VdVeek

Thanks but the post seems to be refering to the Display Style in the modelling environment, whereas I want to change the style of a drawing view.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 4 of 10
mrattray
in reply to: waynehelley

This is from VBA, experiment with it to make it work in iLogic.

 

DrawingView.ViewStyle = kShadedDrawingViewStyle

 

I'm not sure how familiar you are with coding in iLogic, but post back if you need more help.

Mike (not Matt) Rattray

Message 5 of 10
VdVeek
in reply to: mrattray

This iLogic code works for a drawing and changes all views in the selected sheet.

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

' select drawing views on active sheet
Dim oDrawView As DrawingView

For Each oDrawView In oSheet.DrawingViews
'adjust drawing view style
oDrawView.ViewStyle = DrawingViewStyleEnum.kShadedHiddenLineDrawingViewStyle

'OPTIONS TO CHOOSE FROM
' kHiddenLineDrawingViewStyle = 32257
'
kHiddenLineRemovedDrawingViewStyle = 32258
'
kShadedDrawingViewStyle = 32259
'
kShadedHiddenLineDrawingViewStyle = 32261
'
kFromBaseDrawingViewStyle = 32260

Next


Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 6 of 10
waynehelley
in reply to: mrattray

Thanks Mike,

 

I have been having a play around but haven't had any luck yet.  i though the following may work but Inventor can not recognise 'View Style':

ActiveSheet.View("VIEW1").ViewStyle=kshadedDrawingViewStyle

 

I get the folliwng error:

 

Rule Compile Errors in Rule0, in 09090G00105414.idw

Error on Line 1 : 'ViewStyle' is not a member of 'Autodesk.iLogic.Interfaces.ICadDrawingView'.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 7 of 10
waynehelley
in reply to: VdVeek

Thanks VdVeek

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 8 of 10
Alexrose1942
in reply to: VdVeek

@VdVeekfirst of all Thank you! the rule is clear and works fast. how the code should be look like in case i want to change views in all drawing views on all sheets in the idw? (i use multiple sheet idw)

 

Thanks

Message 9 of 10
VdVeek
in reply to: Alexrose1942

@Alexrose1942, for a multisheet drawing the code will be:

Dim oDrawDoc As DrawingDocument
 oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
'oSheet = oDrawDoc.ActiveSheet

For Each oSheet In oDrawDoc.Sheets

    ' select drawing views on active sheet
    Dim oDrawView As DrawingView
    
    For Each oDrawView In oSheet.DrawingViews
    'adjust drawing view style
    oDrawView.ViewStyle = DrawingViewStyleEnum.kShadedHiddenLineDrawingViewStyle
    
    'OPTIONS TO CHOOSE FROM
    '  kHiddenLineDrawingViewStyle = 32257
    '  kHiddenLineRemovedDrawingViewStyle = 32258
    '  kShadedDrawingViewStyle = 32259
    '  kShadedHiddenLineDrawingViewStyle = 32261
    '  kFromBaseDrawingViewStyle = 32260
    
    Next
 
 Next

 

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 10 of 10
Alexrose1942
in reply to: VdVeek

@VdVeekThanks again. super useful!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report