chulse Posted July 18, 2011 Share Posted July 18, 2011 I have a seemingly strange and annoying issue with my startup routine. Most of the time, when I pern a dwg, the paperspace viewport is activated (in mspace). I have added this to my startup routine (in the acaddoc.lsp) but it is still happening. (if (zerop (getvar 'tilemode)) (vla-put-mspace (vla-get-activedocument (vlax-get-acad-object)) :vlax-false)) the code seems to work on the command line, but isn't helping when I open a dwg. Any thoughts? I can't see where/why it always activates the vports... Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 18, 2011 Share Posted July 18, 2011 Perhaps ? (if (and (zerop (getvar 'tilemode)) (eq (vla-get-mspace (vla-get-activedocument (vlax-get-acad-object)) ) :vlax-true ) ) (vla-put-mspace (vla-get-activedocument (vlax-get-acad-object)) :vlax-false ) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 18, 2011 Share Posted July 18, 2011 (defun _toPaper (doc) (if (and (zerop (getvar 'TILEMODE)) (> (getvar 'CVPORT) 1)) (vla-put-mspace doc :vlax-false) ) ) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 18, 2011 Share Posted July 18, 2011 @Chulse - With your code commented out, do your drawings still open with the PViewport activated, even if you were to save the drawing with the PViewport not activated? *IF* so, this suggests that there is separate code that is activating the PViewport(s), which *may* be executed after acaddoc.lsp (S::Startup perhaps?). This is just a guess, I could be totally wrong. @Tharwat - I would avoid calling the ActiveDocument (or any other) Object more than once, unless there has been a change made where calling the object subsequent times makes the desired change(s) available. For the purposes of this thread, consider storing to a local variable (ActiveDoc?). Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 18, 2011 Share Posted July 18, 2011 @Tharwat - I would avoid calling the ActiveDocument (or any other) Object more than once, unless there has been a change made where calling the object subsequent times makes the desired change(s) available. For the purposes of this thread, consider storing to a local variable (ActiveDoc?). That's right and faster . Thank you. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 18, 2011 Share Posted July 18, 2011 That's right and faster . Thank you. No worries; minor detail. Quote Link to comment Share on other sites More sharing options...
chulse Posted July 18, 2011 Author Share Posted July 18, 2011 @Chulse - With your code commented out, do your drawings still open with the PViewport activated, even if you were to save the drawing with the PViewport not activated? *IF* so, this suggests that there is separate code that is activating the PViewport(s), which *may* be executed after acaddoc.lsp (S::Startup perhaps?). This is just a guess, I could be totally wrong.. I suppose I should test more... I added that code to counter this behavior in the first place. I was trying to avoid a snipe hunt. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 18, 2011 Share Posted July 18, 2011 I suppose I should test more... I added that code to counter this behavior in the first place. I was trying to avoid a snipe hunt. Simply save a drawing in the desired state (where PViewport(s) are not activated), and reopen said drawing. *IF* the Pviewport is in the same state, then this may not be the root of your problem. However, *IF* the Pviewport is activated upon reopening, then you need to evaluate what code is being loaded at startup (acaddoc.lsp, startup suite, etc.). Any file(s) you have access to open an view contents (compiled code like .FAS, .VLX etc are non-readable) is where I would start. Good luck! Quote Link to comment Share on other sites More sharing options...
chulse Posted July 18, 2011 Author Share Posted July 18, 2011 Seems like it was something in the startup suite. I need to dig to find it, but at least it's narrowed down to that. Thanks all 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.