Sweety Posted October 22, 2010 Posted October 22, 2010 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 Quote
Lee Mac Posted October 22, 2010 Posted October 22, 2010 What are you trying to achieve? Are you trying to check that the user has selected a Viewport? Quote
Sweety Posted October 22, 2010 Author Posted October 22, 2010 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 Quote
Sweety Posted October 22, 2010 Author Posted October 22, 2010 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 Quote
Lee Mac Posted October 22, 2010 Posted October 22, 2010 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 Quote
Sweety Posted October 22, 2010 Author Posted October 22, 2010 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 Quote
Lee Mac Posted October 22, 2010 Posted October 22, 2010 What do you mean exactly by 'on and off'? Whether Modelspace is active or not? Otherwise look into the ViewportOn property. Quote
lpseifert Posted October 22, 2010 Posted October 22, 2010 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) Quote
Sweety Posted October 22, 2010 Author Posted October 22, 2010 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. Highly appreciated Quote
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.