Rotate isometric view, ilogic?

Rotate isometric view, ilogic?

D0UGLAS
Collaborator Collaborator
1,284 Views
6 Replies
Message 1 of 7

Rotate isometric view, ilogic?

D0UGLAS
Collaborator
Collaborator

I am looking for the ilogic code to rotate an isometric drawing view?

I can rotate the view using stacked hidden views but this is difficult to manage.

D0UGLAS_0-1624438642638.png

 

 

0 Likes
1,285 Views
6 Replies
Replies (6)
Message 2 of 7

CGBenner
Community Manager
Community Manager

@D0UGLAS 

 

What kind of view are you trying to accomplish?  Do you know that if you right click on the view cube, you can use Custom View Orientation?  This takes you to the part model, where you can position the view any way you want, and then capture that as the drawing view.

CGBenner_0-1624445573441.png

 

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

Message 3 of 7

D0UGLAS
Collaborator
Collaborator

Thanks Chris.

 

What I am after is the ilogic code sequence that would do as you say, or other angles of isometricviews depending upon the design logic.

 

 

0 Likes
Message 4 of 7

CGBenner
Community Manager
Community Manager

@D0UGLAS 

Awesome, thanks for clarifying.  I am going to move this thread to the customization forum.  I think you'll find more ilogic experts in there that can help you out.  Good luck!

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes
Message 5 of 7

WCrihfield
Mentor
Mentor

I don't know how proficient you are in iLogic, but if you just want to simply rotate a drawing view by code, you're in luck, because the DrawingView object has a built in method called RotateByAngle that should do what you want.  If you need further help, we can create a sample iLogic rule using this as an example.  But if you need to freely 'orbit' the model in the view to a view angle that isn't built-in, you will either have to do it manually (the way @CGBenner showed), or use iLogic to execute the command behind that option under the view cube, but that will likely still induce the manual model screen for you to orbit the model.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 7

WCrihfield
Mentor
Mentor

Here is an example iLogic rule that you can play with.  As with most things in Inventor, there are many different ways to do things, and this is just one way.  There are many different ways to identify which view you are wanting to target with this rule, but in this example, I'm just specifying which view I want by its name (you will need to change that name to match the name of the view in your drawing, before it will work for you).

 

The code starts out by getting the 'active' document, checking its type, to make sure it is a drawing, then setting it as the value of a variable, so we can continue to work with it.  Then it specifies which sheet in the drawing document we want to work with (the 'active' sheet in this case).  Then it attempts to find the view with the specified name, by looping through all the views on that sheet, and checking their names against the one we specified.  Then it uses that method I linked to in the last post, and specifies 90 degrees as the angle, and True (True  = clockwise).

 

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing Document must be active for this rule to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisApplication.ActiveDocument
'specify which sheet
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
'specify which view
Dim oView As DrawingView
For Each oView In oSheet.DrawingViews
	'get the view by its name
	If oView.Name = "VIEW4" Then '<<< CHANGE THIS VIEW NAME >>>
		oView.RotateByAngle(90, True)
	End If
Next
'there are many different ways to identify which view you want
'You can also select the view manually, either before, or in the middle of the rule, if set up that way

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 7 of 7

Curtis_Waguespack
Consultant
Consultant

Hi @D0UGLAS 

 

In case it is of interest, here is an example that rotates the selected view to use one of the predefined views.

 

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

 

 

'select a view
Dim oView As DrawingView 
oView = ThisApplication.CommandManager.Pick _
(SelectionFilterEnum.kDrawingViewFilter, "Select a view (press ESC to exit selection)") 
Logger.Info(oView.Name)

Dim oList As New ArrayList
oList.Add("Right")
oList.Add("Left")
oList.Add("Top")
oList.Add("Bottom")
oList.Add("Front")
oList.Add("Back")
oList.Add("top Left")
oList.Add("bottom Left")
oList.Add("top Right")
oList.Add("bottom Right")
	
While True
	
	oOrientation = InputListBox("Select one", oList, oOrientation, "ilogic", "List")
	
	If IsNothing(oOrientation) Then Exit While
		Logger.Info(oOrientation)			
		
		oCameraViewType = oView.Camera.ViewOrientationType
		Logger.Info(oCameraViewType)	
		
		If oOrientation = "Back" Then 
			oView.Camera.ViewOrientationType = 10756 					
		ElseIf oOrientation = "Front" Then 
			oView.Camera.ViewOrientationType = 10764			
		ElseIf oOrientation = "Top" Then 
			oView.Camera.ViewOrientationType = 10754			
		ElseIf oOrientation = "Bottom" Then 
			oView.Camera.ViewOrientationType = 10757			
		ElseIf oOrientation = "bottom Left" Then 
			oView.Camera.ViewOrientationType = 10762			
		ElseIf oOrientation = "bottom Right" Then 
			oView.Camera.ViewOrientationType = 10761 			
		ElseIf oOrientation = "top Right" Then 
			oView.Camera.ViewOrientationType = 10759 
		ElseIf oOrientation = "top Left" Then 
			oView.Camera.ViewOrientationType = 10760 			
		ElseIf oOrientation = "Right" Then 
			oView.Camera.ViewOrientationType = 10755 
		ElseIf oOrientation = "Left" Then 
			oView.Camera.ViewOrientationType = 10758			
		End If
		
		oView.Camera.Apply	
		
End While

 

EESignature