+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Full Member DesmetMartin's Avatar
    Computer Details
    DesmetMartin's Computer Details
    Operating System:
    Windows 7- Professional 64bit
    RAM:
    16GB
    Graphics:
    NVIDIA Quadro K4200
    Monitor:
    HP Z22i IPS Display
    Using
    AutoCAD 2016
    Join Date
    Mar 2016
    Location
    Belgium
    Posts
    44

    Default Layer Lisp Question

    Registered forum members do not see this ad.

    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:

    ************************************************** ****************
    Code:
    (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:

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

    Code:
    (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;

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

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

    Thanks!!

    Ps. Check out Lee Mac's lisps!
    Last edited by DesmetMartin; 16th Mar 2016 at 03:49 pm.

  2. #2
    Super Member
    Using
    Civil 3D 2015
    Join Date
    Aug 2015
    Posts
    508

    Default

    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.

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,368

    Default

    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
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  4. #4
    Full Member DesmetMartin's Avatar
    Computer Details
    DesmetMartin's Computer Details
    Operating System:
    Windows 7- Professional 64bit
    RAM:
    16GB
    Graphics:
    NVIDIA Quadro K4200
    Monitor:
    HP Z22i IPS Display
    Using
    AutoCAD 2016
    Join Date
    Mar 2016
    Location
    Belgium
    Posts
    44

    Default

    @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

  5. #5
    Full Member DesmetMartin's Avatar
    Computer Details
    DesmetMartin's Computer Details
    Operating System:
    Windows 7- Professional 64bit
    RAM:
    16GB
    Graphics:
    NVIDIA Quadro K4200
    Monitor:
    HP Z22i IPS Display
    Using
    AutoCAD 2016
    Join Date
    Mar 2016
    Location
    Belgium
    Posts
    44

    Default

    Registered forum members do not see this ad.

    Can somebody still help me?

Similar Threads

  1. Replies: 2
    Last Post: 8th Jan 2016, 11:11 am
  2. lisp to change layer properties if layer name contains text
    By pnoraa in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 19th Sep 2013, 11:58 am
  3. Lisp that will select layer and draw VP and go back to previous layer
    By matthewrussell in forum AutoLISP, Visual LISP & DCL
    Replies: 19
    Last Post: 20th Jan 2009, 09:21 pm
  4. layer group and general layer question
    By jkristia in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 29th Nov 2008, 12:56 pm
  5. Tough Question - Layer Locking (Make Layer Visible But No Pick)
    By johnshar123xx in forum AutoCAD General
    Replies: 1
    Last Post: 21st Nov 2008, 03:20 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts