Jump to content

Recommended Posts

Posted

I can't get this to work can anyone help option one comes u but, not option 2,3 and 4.

 

(defun c:setup ()
(initget "122X34 224X36 330X42 436X48")
(setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (cond
  ((= SHEET "122X34")
   (INITGET "1FULL 21/2=1 31/4=1 41/8=1 51/20=1 61/30=1 71/40=1 81/50=1")
    (SETQ SCALE (getkword "\Enter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:"))
     (cond
      ((= SCALE "1FULL")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "21/2=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "31/4=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "41/8=1")
      (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "51/20=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "61/30=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "71/40=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "81/50=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )              
               )  
             )                
           )
         )
       )
     )
   )
 )
  ((= SHEET "224X36")
   (INITGET "1FULL 21/2=1 31/4=1 41/8=1 51/20=1 61/30=1 71/40=1 81/50=1")
    (SETQ SCALE (getkword "\Enter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:"))
     (cond
      ((= SCALE "1FULL")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "21/2=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "31/4=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "41/8=1")
      (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "51/20=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "61/30=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "71/40=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "81/50=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )   
               )  
             )                
           )
         )
       )
     )
   )
 )
  ((= SHEET "330X42")
   (INITGET "1FULL 21/2=1 31/4=1 41/8=1 51/20=1 61/30=1 71/40=1 81/50=1")
    (SETQ SCALE (getkword "\Enter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:"))
     (cond
      ((= SCALE "1FULL")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "21/2=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "31/4=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "41/8=1")
      (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "51/20=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "61/30=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "71/40=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "81/50=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )   
               )  
             )                
           )
         )
       )
     )
   )
 )
  ((= SHEET "436X48")
   (INITGET "1FULL 21/2=1 31/4=1 41/8=1 51/20=1 61/30=1 71/40=1 81/50=1")
    (SETQ SCALE (getkword "\Enter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:"))
     (cond
      ((= SCALE "1FULL")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "21/2=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "31/4=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "41/8=1")
      (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "51/20=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "61/30=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "71/40=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )
      ((= SCALE "81/50=1")
       (COMMAND "DIMSCALE" "1" "LTSCALE" ".5")
     )             
                   )                
                 )
               )
             )
           )
         )
       )    
     )
   )
(princ)
)

 

Thanks in advance! What I have in each command is not what I am using but this is just general so I am just trying to get the options to work first.

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

  • neekcotrack

    25

  • Footpeg

    22

  • CAB

    5

  • Strix

    1

Posted

A bunch of closing parenthesis were in wrong places and way too many of them. Since all of the scale prompts are identical, you only need it once. I also made the variables SHEET and SCALE local by including them on the defun line. I edited the values in the 22x34 group for testing. Be sure to adjust them if they are not what you want.

 

(defun c:setup ( / SHEET SCALE)
 (initget "122X34 224X36 330X42 436X48")
 (setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (initget "1FULL 21/2=1 31/4=1 41/8=1 51/20=1 61/30=1 71/40=1 81/50=1")
 (setq SCALE (getkword "\nEnter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:"))
 (cond
   ((= SHEET "122X34")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "24" "LTSCALE" "12")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "48" "LTSCALE" "24")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "96" "LTSCALE" "48")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "240" "LTSCALE" "120")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "360" "LTSCALE" "180")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "480" "LTSCALE" "240")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "600" "LTSCALE" "300")
      )
    ) ;_ cond
   )
   ((= SHEET "224X36")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   )
   ((= SHEET "330X42")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   )
   ((= SHEET "436X48")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   )
 ) ;_ cond
 (princ)
) ;_ defun c:setup

Footpeg

Posted

Not tested, nor is it complete.

(defun c:setup ( / SHEET SCALE sc)
 (initget "1 2 3 4")
 (setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (initget "1 2 3 4 5 6 7 8")
 (setq SCALE (getkword "\nEnter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:"))
 (cond
   ((= SHEET "1")
    (setq sc (nth (1- (atoi SCALE)) '(1 24 48 96 240 360 480 600)))
    (command "DIMSCALE" sc "LTSCALE" (/ sc 0.2))
   )
   ((< "1" SHEET "5") ; true if SHEET is 2-4
      (command "DIMSCALE" "1" "LTSCALE" ".5")
   )
 ) ;_ cond
 (princ)
) ;_ defun c:setup

Posted

Footpeg,

 

I tried yours but I just can't get it to work when I pick the sheet it says invalid option keyword.

Posted

Just type 1, 2, 3 or 4, not the brackets.

 

Footpeg

Posted

I did do that but still the same messege, but I am testing it on AutoCAD 2005 because thats all I have with me right now. Will that make a difference?

Posted

I don't think so, but I don't have 2005 available to test it.

 

Did it throw that error after the sheet prompt or the scale prompt?

 

Maybe INITGET doesn't like the equal sign in 2005 (I'm using 2008 and it's okay). Try taking them out like this:

 

(initget "1FULL 21/2 31/4 41/8 51/20 61/30 71/40 81/50")

Footpeg

Posted

It is still doing the samething after taking the = out. It is doing at the sheet option.

Posted

Hmm... Then the problem is prior to the equal sign issue (which is probably not an issue). It sounds like something is messed up with your INITGET statement. It should look like the one in the code box below. If not, fix it and try again.

 

If it looks the same, paste the 4 lines in the code box below onto the AutoCAD command line (you may have to press ENTER after pasting. The Sheet prompt should be issued. Enter a number and see what happens (it should echo the sheet size).

 

(progn
(initget "122X34 224X36 330X42 436X48")
(setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
)

 

Footpeg

Posted

If it still does not work, post your code and I'll see what I can find.

 

Footpeg

Posted
If it still does not work, post your code and I'll see what I can find.

 

Footpeg

(defun c:setup ( / SHEET SCALE)
 (initget "122X34 224X36 330X42 436X48")
 (setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (initget "1FULL 21/2 31/4 41/8 51/20 61/30 71/40 81/50")
 (setq SCALE (getkword "\nEnter Scale [1]FULL,[2]1/2,[3]1/4,[4]1/8,[5]1/20,[6]1/30,[7]1/40,[8]1/50:"))
 (cond
   ((= SHEET "122X34")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "24" "LTSCALE" "12")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "48" "LTSCALE" "24")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "96" "LTSCALE" "48")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "240" "LTSCALE" "120")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "360" "LTSCALE" "180")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "480" "LTSCALE" "240")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "600" "LTSCALE" "300")
      )
    ) ;_ cond
   )
   ((= SHEET "224X36")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   )
   ((= SHEET "330X42")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   )
   ((= SHEET "436X48")
    (cond
      ((= SCALE "1FULL")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "21/2=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "31/4=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "41/8=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "51/20=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "61/30=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "71/40=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "81/50=1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   )
 ) ;_ cond
 (princ)
) ;_ defun c:setup

Posted

And I don't think you will get it to work unless you seperate the leading number with a character ie 1-22X34

 

Why do you need all those charactera anyway?

Posted

Your code works okay for me. Here's the command line:

  • Command: setup
    Enter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: 1
    Enter Scale [1]FULL,[2]1/2,[3]1/4,[4]1/8,[5]1/20,[6]1/30,[7]1/40,[8]1/50:2
    Command:

What happens if you type 122X34 for the size prompt?

 

Footpeg

Posted
And I don't think you will get it to work unless you seperate the leading number with a character ie 1-22X34

 

Why do you need all those charactera anyway?

 

What I want it to do more then what I give you. What it will is all depending on the scale and sheet size it will make at box on model space to the sheet size and size and dimscale and ltscale and make a viewports in paper space and scale the viewport to the scale.

Posted

What CAB means is why not simplify the INITGET statement, like the following (the prompts can still echo the sheet sizes and scale factors):

 

 (initget "1 2 3 4")
 (setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (initget "1 2 3 4 5 6 7 8")
 (setq SCALE (getkword "\nEnter Scale [1]FULL,[2]1/2,[3]1/4,[4]1/8,[5]1/20,[6]1/30,[7]1/40,[8]1/50: "))

Making that change requires changing all of the condition statements as well. Here's the completed code:

(defun c:setup ( / SHEET SCALE)
 (initget "1 2 3 4")
 (setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (initget "1 2 3 4 5 6 7 8")
 (setq SCALE (getkword "\nEnter Scale [1]FULL,[2]1/2,[3]1/4,[4]1/8,[5]1/20,[6]1/30,[7]1/40,[8]1/50: "))
 (cond
   ((= SHEET "1")
    ;; 22X34
    (cond
      ((= SCALE "1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "2")
       (command "DIMSCALE" "24" "LTSCALE" "12")
      )
      ((= SCALE "3")
       (command "DIMSCALE" "48" "LTSCALE" "24")
      )
      ((= SCALE "4")
       (command "DIMSCALE" "96" "LTSCALE" "48")
      )
      ((= SCALE "5")
       (command "DIMSCALE" "240" "LTSCALE" "120")
      )
      ((= SCALE "6")
       (command "DIMSCALE" "360" "LTSCALE" "180")
      )
      ((= SCALE "7")
       (command "DIMSCALE" "480" "LTSCALE" "240")
      )
      ((= SCALE "8")
       (command "DIMSCALE" "600" "LTSCALE" "300")
      )
    ) ;_ cond
   ) ;_ cond
   ((= SHEET "2")
    ;; 24X36
    (cond
      ((= SCALE "1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "2")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "3")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "4")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "5")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "6")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "7")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "8")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   ) ;_ cond
   ((= SHEET "3")
    ;; 30X42
    (cond
      ((= SCALE "1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "2")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "3")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "4")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "5")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "6")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "7")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "8")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   ) ;_ cond
   ((= SHEET "4")
    ;; 36X48
    (cond
      ((= SCALE "1")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "2")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "3")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "4")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "5")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "6")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "7")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
      ((= SCALE "8")
       (command "DIMSCALE" "1" "LTSCALE" ".5")
      )
    ) ;_ cond
   ) ;_ cond
 ) ;_ cond
 (princ)
) ;_ defun c:setup

Footpeg

Posted

You can also use this form:

  (initget "1-22X34 2-24X36 3-30X42 4-36X48")
 (setq SHEET (getkword "\nEnter Sheet [1-22X34\2-24X36\3-30X42\4-36X48]: "))
 (initget "1-FULL 2-1/2 3-1/4 4-1/8 5-1/20 6-1/30 7-1/40 8-1/50")
 (setq SCALE (getkword "\nEnter Scale [1-FULL\2-1/2\3-1/4\4-1/8\5-1/20\6-1/30\7-1/40\8-1/50]: "))

You will need to change the condition test to use this form.

Posted

I want to add a Custom option. ([9]Custom). It will be what I type in. Lets say what I typed in is:

 

(setq cscale............

 

and half of it is:

 

(set cscale1 (/ cscale 2)) I think this is right?

 

Below is the values that will be multipled by cscale or cscale1. Anything that is red will be multipled by cscale, and blue by cscale1.

 

I used the layout from post #15. CAB's good idea!

 

(COMMAND "RECTANG" "0,0" "34,22" "_.ZOOM" "C" "17,11" "24")

(COMMAND "DIMSCALE" "1" "LTSCALE" ".5")

(COMMAND "_.LAYOUT" "S" "22x34" "ORTHO" "ON" "_.VPORTS" "P" "2,2" "@30

(COMMAND "MSPACE" "_.ZOOM" "C" "17,11" "24" "_.ZOOM" "1/1XP" "PSPACE" "_.ZOOM" "A")

(COMMAND "_.LAYER" "S" "0" "LO" "DEFPOINTS" "")

 

I hope this makes sense thanks for everything in advance.

Posted

OK, this is a ROUGH draft, no testing.

(defun c:setup ( / SHEET SCALE sc sh xp recSize zomSize)
 (initget "1 2 3 4")
 (setq SHEET (getkword "\nEnter Sheet [1]22X34,[2]24X36,[3]30X42,[4]36X48: "))
 (initget "1 2 3 4 5 6 7 8 9")
 (setq SCALE (getkword "\nEnter Scale [1]FULL,[2]1/2=1,[3]1/4=1,[4]1/8=1,[5]1/20=1,[6]1/30=1,[7]1/40=1,[8]1/50=1:,[9]Custom"))
 (if (= SCALE "9")
   (progn ; Needs Error checking
     (setq sc (getdist "\nEnter scale: "))
   )
   (setq sc (nth (1- (atoi SCALE)) '(1 24 48 96 240 360 480 600)))
 )
 (setq sh (nth (1- (atoi SHEET)) '((34 22)(36 24)(42 30)(48 36)))))
 (setq xp (strcat "1/" (itoa sc)  "XP"))
 
 (if (and sc sh)
   (progn
     (setq recSize (strcat (rtos (* (car sh) sc) "," (strcat (rtos (* (cadr sh) sc))
           zomSize (strcat (rtos (* (car sh) (/ sc 2.0)) "," (strcat (rtos (* (cadr sh) (/ sc 2.0))
     (COMMAND "RECTANG" "0,0" recSize "_.ZOOM" "C" zomSize (* sc 24))
     (COMMAND "DIMSCALE" sc "LTSCALE" (/ sc 2.0))
     (COMMAND "_.LAYOUT" "S" "22x34" "ORTHO" "ON" "_.VPORTS" "P" "2,2" "@30<0" "@18<90" "@30<180" "@18<270" "")
     (COMMAND "MSPACE" "_.ZOOM" "C" zomSize (* sc 24) "_.ZOOM" xp "PSPACE" "_.ZOOM" "A")
     (COMMAND "_.LAYER" "S" "0" "LO" "DEFPOINTS" "")
   )
 )

 (princ)
) ;_ defun c:setup

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