Jump to content
DesmetMartin

Layer Lisp Question

Recommended Posts

DesmetMartin

I have a Lisp from Lee Mac which I would like to be modified.

 

I would like to have a setting that let's you choose which layer it should be on.

I have tried to write something myself and only came up with this:

******************************************************************

(setq TASH (getint "\nChoose dimensions layer: Dim. (1), Front view (2)"))
 ); end while

   
   ); progn
 );TASH = 1, Dim
 (if (= TASH 1 )
   (progn
     ; S-Dimensions
       (command "DIM*"		       		"S-DIMENSIONS"   "Dimension Layer"              3        "Continuous"           -3                 1       	    nil         )

   ); progn
 ); if (= TAMR 1)

 

******************************************************************

and:

 

******************************************************************

 

(defun CommandReactor:CommandWillStart (rea cmd)
 (if (wcmatch (strcase (car cmd)) "*DIM*")
   	(progn
     		(setq *OldClayer* (getvar 'clayer))
     			(vla-add
		        (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
			        (setq TASH (getint "\nChoose dimensions layer: Dim. (1), Front view (2)"))
 						); end while

     (setvar 'clayer layerName)
   )
 )
)

 

******************************************************************

But I don't know were to put it in the existing lips from Lee Mac.

Can anyone help?

 

 

 

The lisp from Lee Mac is now;

******************************************************************

 

http://lee-mac.com/lisp/html/LayerDirectorV1-4.html

 

******************************************************************

Thanks!!

 

Ps. Check out Lee Mac's lisps!

Edited by DesmetMartin

Share this post


Link to post
Share on other sites
broncos15

First off, as part of Lee's terms of use, he doesn't want others posting his codes, but rather a link to them, see this link: http://lee-mac.com/terms.html. Lee is awesome to provide these programs, so please just delete his code above. Now onto your question, the easiest way to do this is to have a new LISP routine that calls two different versions of Lee's program. Have two different copies of his program (you will need to rename the functions in the 2nd one). You then would call both programs in another LISP routine that turns on either program a, program b, or turns them off.

Share this post


Link to post
Share on other sites
Lee Mac

Thank you broncos, I very much appreciate your respect & support.

 

DesmetMartin, please refer to my response to your email enquiry sent through my site - I have provided a prototype version of my Layer Director application which incorporates a VIEWDIR test to enable automatic dimension layer selection depending on your view configuration.

 

Lee

Share this post


Link to post
Share on other sites
DesmetMartin

@Broncos15; I changed it immediately, I did not know this was in Lee Mac's terms. My apology for this.

 

@ Lee mac; First of all: thanks for the fast responds!

Second: The responds I got from you is with Viewdir.

But is it possible to get a "question" which layer you want when you want to place a DIM, and if you then press a number you get the layer which you choose?

 

For example:

 

Example.jpg

--> I got this but I can't find how to get it linked to the layers.

 

Thanks!

- DesmetMartin

Share this post


Link to post
Share on other sites
DesmetMartin

Can somebody still help me?

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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