Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results forย 
Showย ย onlyย  | Search instead forย 
Did you mean:ย 

How to change Drawing View orientation from 'Back' to 'Front' using iLogic?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
sohaib.as01
1618 Views, 3 Replies

How to change Drawing View orientation from 'Back' to 'Front' using iLogic?

Hello everyone,

Can someone point me towards the piece of code in iLogic/API to change the view orientation of an already placed drawing View, having a view name lets say "VIEW1" from "BACK" to "FRONT"? Back and Front being the view orientations shown by the View Cube when placing base view.

All I could find is how to create/place base view from scratch but I just cant figure it out to change orientation of an already placed drawing view.

Thanks alot for helping ๐Ÿ™‚

Labels (3)
3 REPLIES 3
Message 2 of 4
FINET_Laurent
in reply to: sohaib.as01

Morning,

 

Waking up to this little challenge on a sunday morning with a cut of coffee.

Managed to pull this out :

 

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oView As DrawingView
oView = oSheet.DrawingViews.Item(1)

Dim FrontView As ViewOrientationTypeEnum = kFrontViewOrientation
oView.Camera.ViewOrientationType = FrontView

oView.Camera.Apply

 oView.Camera.Apply was the tricky part.

 

Hopes this helps out,

 

Regards,

 

 FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

Message 3 of 4

Added lines to specify the view name. ๐Ÿ˜ƒ

 

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oView As DrawingView

Dim ViewName As String = "VIEW1" 'your view name that you want to target
Dim FrontView As ViewOrientationTypeEnum = kFrontViewOrientation 'define the orientation you wanr

For Each oView In oSheet.DrawingViews 'look through all the referenced views
	
	If ViewName.Equals(oView.Name) = True Then

			oView.Camera.ViewOrientationType = FrontView
			oView.Camera.Apply
	
	End If

Next

 Reagrds,

 

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

Message 4 of 4
sohaib.as01
in reply to: FINET_Laurent

Heyyy @FINET_Laurent Thank you so much for taking your time out and solving my problem. Worked like a charm. Thanks alot buddy. Sorry for replying o late, was just stuck with an emergency so couldnt work whole week.

Godspeed to you.

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

Post to forums  

Autodesk Design & Make Report