Jump to content

Recommended Posts

Posted

Hello everbody.

 

I wonder how to get the correct name of the property for viewport in the following example of codes !

 

Any help please ?

 

(vl-load-com)
(setq vp  (entsel "\n Select Viewport :"))
(setq obj (vlax-ename->vla-object (car vp)))
(setq VPstatus (vlax-get-property obj [color="red"]'viewport[/color]) );
             (vlax-put-property obj ......... true or false 
             

 

Thanks

Posted

What are you trying to achieve? Are you trying to check that the user has selected a Viewport?

Posted

Thanks Lee.

 

I am trying to check the status of the selected viewport first, and afterall I may keep on or put it off .

 

Regards

Posted
Look into the MSpace property.

 

That's right, I've seen that before, but my problem is how to use it with function (vlax-put-property obj .......) as I mentioned in my first post .

 

Mspace and display method are explained well about the same issue.

 

Thanks

Posted
I am trying to check the status of the selected viewport first, and afterall I may keep on or put it off .

 

For checking:

 

(vla-get-MSpace (vla-get-ActiveDocument (vlax-get-acad-object)))

 

(Be sure that you are in Paperspace when checking)

 

For changing:

 

(vla-put-MSpace (vla-get-ActiveDocument (vlax-get-acad-object)) :vlax-true)

 

Lee

Posted

Thanks.

 

That's to check the mspace in the active drawing ,but I want to toggle the selected viewport on and off .

 

It's different. isn't it ?

 

Regards

Posted

What do you mean exactly by 'on and off'? Whether Modelspace is active or not?

 

Otherwise look into the ViewportOn property.

Posted

Are you aware of the vlax-dump-object function? You might want to read about it in Developer Help, it may be a good tool for you.

 

this will turn a viewport on

(vlax-put-property obj 'ViewportOn :vlax-true)

Posted
What do you mean exactly by 'on and off'? Whether Modelspace is active or not?

Otherwise look into the ViewportOn property.

 

Thanks Lee. This is what I used before to chech the status if on or off with *if* function. But I couldn't change the status of the selected viewport.

 

like the following ..

 

(if (= (vlax-get-property obj 'ViewportOn) :vlax-false)
               (vlax-put-property obj ......... true or false   <-- this is the part that was hard to me to put it on.

 

 

Are you aware of the vlax-dump-object function? You might want to read about it in Developer Help, it may be a good tool for you.

this will turn a viewport on

(vlax-put-property obj 'ViewportOn :vlax-true)

 

A great work Mr.lpseifert .:)

 

Thank you so much for your great help. :thumbsup:

 

Highly appreciated

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