Inventor General Discussion

Inventor General Discussion

Reply
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 1 of 7 (417 Views)
Accepted Solution

Ilogic - Make drawing view shaded.

417 Views, 6 Replies
01-22-2013 02:03 AM

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 :smileysad:

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit

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


Distinguished Contributor
VdVeek
Posts: 117
Registered: ‎09-13-2012
Message 2 of 7 (404 Views)

Re: Ilogic - Make drawing view shaded.

01-22-2013 03:22 AM 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.
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 3 of 7 (375 Views)

Re: Ilogic - Make drawing view shaded.

01-23-2013 12:01 AM 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 2013
Windows 7 Enterprise, 64-bit
*Expert Elite*
mrattray
Posts: 2,517
Registered: ‎09-13-2011
Message 4 of 7 (362 Views)

Re: Ilogic - Make drawing view shaded.

01-23-2013 05:49 AM 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

Distinguished Contributor
VdVeek
Posts: 117
Registered: ‎09-13-2012
Message 5 of 7 (352 Views)

Re: Ilogic - Make drawing view shaded.

01-23-2013 06:14 AM 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.
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 6 of 7 (348 Views)

Re: Ilogic - Make drawing view shaded.

01-23-2013 06:27 AM 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 2013
Windows 7 Enterprise, 64-bit
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 7 of 7 (346 Views)

Re: Ilogic - Make drawing view shaded.

01-23-2013 06:30 AM in reply to: VdVeek

Thanks VdVeek

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!