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

sohaib.as01
Advocate
Advocate

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

sohaib.as01
Advocate
Advocate

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 🙂

0 Likes
Reply
Accepted solutions (1)
1,716 Views
3 Replies
Replies (3)

FINET_Laurent
Advisor
Advisor

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

FINET_Laurent
Advisor
Advisor
Accepted solution

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

sohaib.as01
Advocate
Advocate

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.