iLogic drawing view controls in drawing files

iLogic drawing view controls in drawing files

tonychristman4915
Explorer Explorer
3,109 Views
7 Replies
Message 1 of 8

iLogic drawing view controls in drawing files

tonychristman4915
Explorer
Explorer

Hello all,

 

I'm looking for how to use inventor iLogic to activate and deactivate the "Definition in Base View" option for drawing views. This is found by double clicking on a drawing view and selecting the "Display Options" tab.

 

I have a drawing file that uses an iLogic rule to activate and place section views but I want to give the option to our engineering staff to change the locations of the section views, then run a rule that hides all the arrows that clog up the Base view without having to click on every view manually.

 

The closest post I've found was this one: http://forums.autodesk.com/t5/inventor-general-discussion/ilogic-make-drawing-view-shaded/td-p/37586... that discussed how to use iLogic to change the view style, however I haven't discovered how to control the "Definiton in Base View" option yet.

 

Thanks!

0 Likes
Accepted solutions (1)
3,110 Views
7 Replies
Replies (7)
Message 2 of 8

Curtis_Waguespack
Consultant
Consultant

Hi tonychristman4915,

 

Here's a quick example based on the one at the link you provided.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

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
	If oDrawView.ViewType = DrawingViewTypeEnum.kDetailDrawingViewType Then
		'toggle detail view fence visiblility
		If oDrawView.DisplayDefinitionInBase = False Then
		oDrawView.DisplayDefinitionInBase = True
		Else
		oDrawView.DisplayDefinitionInBase = False
		End If
	End If
Next

' **** DrawingViewTypeEnums ****
'	kAssociativeDraftDrawingViewType = 10506 
'	kAuxiliaryDrawingViewType = 10499 
'	kCustomDrawingViewType = 10498 
'	kDefaultDrawingViewType = 10497 
'	kDetailDrawingViewType = 10502  
'	kDraftDrawingViewType = 10505 
'	kOLEAttachmentDrawingViewType = 10500  
'	kOverlayDrawingViewType = 10507 
'	kProjectedDrawingViewType = 10504 
'	kSectionDrawingViewType = 10503 
'	kStandardDrawingViewType = 10501 

EESignature

0 Likes
Message 3 of 8

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Here's another example that turns off sections arrows/lines for sections views:

 

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	
	'look for section views
	If oDrawView.ViewType = DrawingViewTypeEnum.kSectionDrawingViewType Then
		'turn off section view annotations
		oDrawView.DisplayDefinitionInBase = False
	End If
Next

EESignature

Message 4 of 8

tonychristman4915
Explorer
Explorer

This worked perfectly and was exactly what I was looking for. Thanks!

0 Likes
Message 5 of 8

LSKELLY
Enthusiast
Enthusiast

Hi Curtis

 

I have been looking for a way to change the Model State of a DrawingView object. I can't find any settings in the object browser. Any chance I am missing it under an obscure name?

 

I half expect it to look something like: 

 

Dim oDrawView As DrawingView
oDrawView.ModelState = "Machining" 

 

Lance Skelly

0 Likes
Message 6 of 8

LSKELLY
Enthusiast
Enthusiast

Don't worry I found it. The following snippet illustrates how to change the Model State of a weldment view.

 

'Create View
oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, ViewScale, ViewOrientationTypeEnum.kIsoTopRightViewOrientation, DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle)
                
'View Settings
oBaseView.DisplayForeshortenedTangentEdges = True
If oPartDoc.DocumentSubType.DocumentSubTypeID = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" 'If Weldment
    oBaseView.SetWeldmentState(WeldmentStateEnum.kMachiningWeldmentState)
End If

 

Message 7 of 8

dbushDQ3RE
Participant
Participant

HI Guts,

Making the view is one thing, put how do I access the (Welds Model State) and the (Welds components) in that view to Make Dimensions on named Faces using ILogic. I can make Dimensions for the (Assembly Model State) and its Components). ........

0 Likes
Message 8 of 8

A.Acheson
Mentor
Mentor

Hi @dbushDQ3RE 

 

I would suggest to make a new post as this original post is solved and relates to a very generic question "iLogic drawing view controls in drawing files"

 

Your question relates to multiple questions each likely deserving its own post due to there complications.  

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes