Jump to content

Hiaracy


JONTHEPOPE

Recommended Posts

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")?o:)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

 
(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 ??

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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