Jump to content

Autolisp - camera position


jan_ek

Recommended Posts

PERSPECTIVE

VIEWDIR

VIEWCTR

 

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

Link to comment
Share on other sites

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 ()

 

Link to comment
Share on other sites

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)...

Link to comment
Share on other sites

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).

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...