Jump to content

Recommended Posts

Posted

Each viewport has an xdata set named "ACAD".

  (setq obj (vlax-ename->vla-object (car(entsel "\nSelect: "))))
  (vla-GetXData obj "ACAD" 'XDataType 'XDataValue)
  (setq dat (vlax-safearray->list XDataType))
  (setq val (vlax-safearray->list XDataValue))
  (mapcar 'print (setq out (mapcar 'vlax-variant-value val)))

the code returns a list xdata of viewport:

"ACAD"
"MVIEW"
"{"
16
#<safearray...>
#<safearray...>
0.0
62.4
0.0
0.0
50.0
0.0
0.0
0
1000
1
3
0
0
0
0
0.0
0.0
0.0
0.5
0.5
0.5
0.5
0
"{"
"}"
"}"

 

How to modify this xdata set?

Can viewports be modified by changing the value of the "ACAD" xdata set?

 

Posted (edited)

What are you trying to ? Change size, scale, twist, lock to mention a couple of choices.

Edited by BIGAL
Posted (edited)
7 hours ago, BIGAL said:

What are you trying to ? Change size, scale, twist, lock to mention a couple of choices.

I'm using a 2d viewport.

I want to set the viewport center in model space for coordinate data. I know this can be done by entering the viewport, using zoom, and exiting the viewport.. I'm looking for a method to center the viewport view in model space without going into the viewport. The xdata "ACAD" viewport editing method seems the way to go for this.

Edited by Kowal
Posted

This may be a way, note mp is a point in modelspace. This includes a twist angle.

(command "mspace")
(command "zoom" "C" mp 500)
(command "UCS" "Z" ang "plan" "")
(command "UCS" "W")
(command "zoom" "C" mp (strcat (rtos ahsc 2 1) "XP") )
(command "Psltscale" 1)
(command "pspace")
(vla-put-DisplayLocked obj  -1)

 

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