Kowal Posted February 19 Share Posted February 19 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? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 20 Share Posted February 20 (edited) What are you trying to ? Change size, scale, twist, lock to mention a couple of choices. Edited February 20 by BIGAL Quote Link to comment Share on other sites More sharing options...
Tsuky Posted February 20 Share Posted February 20 (edited) 3 hours ago, Kowal said: Can viewports be modified by changing the value of the "ACAD" xdata set? You cannot use the entmod function to modify a viewport entity. But with ActiveX, it may be possible RemarksThe ActiveSpace property (equivalent to the TILEMODE system variable) determines the type of viewport used.No editing or view changes can be performed unless the viewport is active. To make a viewport active, use the ActiveViewport property on the Document object.Once changes have been completed, the viewport must be reset as the active viewport for the changes to appear. To reset the active viewport, simply call the ActiveViewport property again with the updated Viewport object. Edited February 20 by Tsuky Quote Link to comment Share on other sites More sharing options...
Kowal Posted February 20 Author Share Posted February 20 (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 February 20 by Kowal Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 20 Share Posted February 20 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) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.