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 ๐
Solved! Go to Solution.
Solved by FINET_Laurent. Go to Solution.
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"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"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.