JONTHEPOPE Posted September 18, 2008 Share Posted September 18, 2008 WHEN IS IT RELAVENT FOR ME TO USE CODE SUCH AS (setq *Modle space* (ula-get-modleSpace(vla-get-activedocument (vlax-get-acad object)))) so im telling code to go to modle space active doc. I assume but i'm not sure with what context i should use it (active "x")? Quote Link to comment Share on other sites More sharing options...
borgunit Posted September 18, 2008 Share Posted September 18, 2008 The above does not change your active space. It just sets a variable to the object (ModelSpace). Later in code you could use it to add objects to, or to manipulate things. It should be in the help I would think. Quote Link to comment Share on other sites More sharing options...
ASMI Posted September 18, 2008 Share Posted September 18, 2008 There is 5 errors: (setq *Modle space* (ula-get-modleSpace(vla-get-activedocument (vlax-get-acad object)))) (setq mSpace (vla-get-modelSpace(vla-get-activedocument (vlax-get-acad-object)))) You can't to use * in variable names and can't to name variables with spaces as Modle space. Quote Link to comment Share on other sites More sharing options...
borgunit Posted September 18, 2008 Share Posted September 18, 2008 Actually I think you can use this variable name. From the AutoCAD help... Obtaining a Pointer to Model Space (setq *ModelSpace* (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-Acad-Object)))) You can use the variable *ModelSpace* anytime you call an ActiveX entity creation function. The only tricky thing with this scheme is the *ModelSpace* variable must be ready to go before you start drawing. For this reason, the setq establishing this variable will be called at the time the application is loaded, immediately after the call to vl-load-com. These calls will be placed before any defun in the program file. As a result, they are executed as soon as the file is loaded. Quote Link to comment Share on other sites More sharing options...
JONTHEPOPE Posted September 18, 2008 Author Share Posted September 18, 2008 IT 's pretty hard to thumb through all the acda help files. they really dont explain anything well . thanks for the quick replys . do people use visual lisp (lisp) for other applications besides acad ? (I.T.) ? electronics ? Quote Link to comment Share on other sites More sharing options...
JONTHEPOPE Posted September 18, 2008 Author Share Posted September 18, 2008 (setq mSpace (vla-get-modelSpace(vla-get-activedocument (vlax-get-acad-object)))) so i have to have drawing open for this code to work could i tell lisp about my preferences ?? Quote Link to comment Share on other sites More sharing options...
borgunit Posted September 18, 2008 Share Posted September 18, 2008 Sorry I got off track. You can set a lot of things just with variables. ie (setvar "TILEMODE" 1) ;modelspace (setvar "TILEMODE" 0) ;paperspace (setvar "GRIDMODE" 0) etc.. you get the idea 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.