Jump to content
jan_ek

Autolisp - camera position

Recommended Posts

jan_ek

Hello
I would like to save view position to txt file.
What variables do I need to save?

Share this post


Link to post
Share on other sites
marko_ribar

PERSPECTIVE

VIEWDIR

VIEWCTR

 

Basically VIEWCTR = TARGET, when UCS=WCS (mapcar '+ (getvar 'VIEWCTR) (getvar 'VIEWDIR)) = CAMERA, PERSPECTIVE (1= in perspective, 0= in parallel vector projection)

Share this post


Link to post
Share on other sites
jan_ek

Hello
Thanks for quick answer but how restore this variable.

 

Share this post


Link to post
Share on other sites
ronjonp

You want to save the camera location to a text file? A quick properties dump has all the info I think you need:

Quote

; IAcCameraWrapper: IAcCameraWrapper Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff633f06558>
;   BackPlane = 0.0
;   Clipping = "Off"
;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000025166e7f698>
;   EntityTransparency = "ByLayer"
;   FieldOfView = 0.691111
;   FrameHeight = 4.35699
;   FrameWidth = 6.53549
;   FrontPlane = 0.0
;   Handle (RO) = "9E"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000002516fa7e228>
;   IsPlotable = 0
;   Layer = "*temporary_system_cameras_layer"
;   LensLength = 50.0
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Location = (2.76479 4.11262 0.0)
;   Material = "ByLayer"
;   Name = "Camera1"
;   ObjectID (RO) = 43
;   ObjectName (RO) = "AcDbCamera"
;   OwnerID (RO) = 44
;   PlotStyleName = "ByLayer"
;   RollAngle = 0.0
;   Target = (11.4619 7.54752 0.0)
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 000002516fa7e700>
;   Visible = -1
; Methods supported:
;   ArrayPolar (3)
;   ArrayRectangular (6)
;   Copy ()
;   Delete ()
;   GetBoundingBox (2)
;   GetExtensionDictionary ()
;   GetXData (3)
;   Highlight (1)
;   IntersectWith (2)
;   Mirror (2)
;   Mirror3D (3)
;   Move (2)
;   Rotate (2)
;   Rotate3D (3)
;   ScaleEntity (2)
;   SetXData (2)
;   TransformBy (1)
;   Update ()

 

Share this post


Link to post
Share on other sites
marko_ribar
6 hours ago, jan_ek said:

Hello
Thanks for quick answer but how restore this variable.

 

I think you can use DVIEW command with PO - points option and enter coordinates... For perspective use (setvar 'perspective 1) or (setvar 'perspective 0)...

Share this post


Link to post
Share on other sites
jan_ek

Hello, I can not use this suggestions.

Perhaps I have asked the question wrong or i don't understand answers

I would like to:
1. Save view to file.
2. Load save file
3. Automatically rotate and zoom view (use variable to file).

 

Share this post


Link to post
Share on other sites
David Bethel

Have you looked into the view table.

 

Command : _.VIEW -Save TEST

 

Command : (tblsearch "VIEW" TEST)

 

The table can be saved to a text file and fairly easily restored.

 

-David

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×