Author Topic: Basic lisp help needed  (Read 5281 times)

0 Members and 1 Guest are viewing this topic.

grush

  • Guest
Basic lisp help needed
« on: February 16, 2005, 09:26:03 AM »
This is copied from my mnu file. I would like to create a simple lisp to do this instead of using my pull down menu. Anybody care to help? I know nothing about writing a lisp, sad to say. I looked for a lisp routine, but I could not find one that I liked.

   [--]
[Draw Walls]^C^C_CLAYER;WALL;DL;W;6;
   [--]
[Room Names]^C^C_CLAYER;ROOM-NAME;DT;J;M; \0;


grush

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Basic lisp help needed
« Reply #1 on: February 16, 2005, 09:57:09 AM »
What is DL?  That must be a routine or an alias to another command.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Basic lisp help needed
« Reply #2 on: February 16, 2005, 10:00:08 AM »
(defun c:RmNm()
  (setvar "clayer" "ROOM-NAME")
  (COMMAND "DTEXT" "j" "M" PAUSE 0))


This assumes that the layer exists, and that your text style has a preset text height. (I made those assumptions based on you menu macro)
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

grush

  • Guest
Basic lisp help needed
« Reply #3 on: February 16, 2005, 10:30:34 AM »
DL stands for dline.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Basic lisp help needed
« Reply #4 on: February 16, 2005, 10:39:26 AM »
What version of Acad do you have?  I dont have a Dline, but I do have a Mline.

(defun c:DrawWall ()
  (setvar "clayer" "Wall")
  (COMMAND "mline" "s" "6")
)

OR THIS MIGHT WORK
(defun c:DrawWall ()
  (setvar "clayer" "Wall")
  (COMMAND "dline" "w" "6")
)
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Basic lisp help needed
« Reply #5 on: February 16, 2005, 11:19:57 AM »
I dont have a dline command either. *shrug*

For what its worth, Here is my version.
Code: [Select]

(defun c:MyButtonReplacement ( / layer?)
  ;; Suport procedure
  ;; it will test to see if a layer exists
   (defun layer? (n) (and (tblsearch "LAYER" n)))
  ;; Test to see if layer exists in drawing
 (cond
   ((layer? "Wall")
   ;; if it does then set it to the current layer
    (setvar "clayer" "Wall")
   ;; and start the mline command
    (command "mline" "s" "6")
    )
   ;; otherwise Inform the use that the layer dosnet exist.
   (T
     "Layer dosnet exist"
     )
   )
 )
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

<spell check police>

  • Guest
Basic lisp help needed
« Reply #6 on: February 16, 2005, 11:31:05 AM »
*Beep*. Syntax error: "I dont have a ... ".

Alternates:

"I don't have a ..."
"I do not have a ..."
"DLINE? WT* is that?"

*Beep*. Syntax error: "layer dosnet exist".

Alternates:

"Layer does not exist."
"Layer doesn't exist."
"Layer wasn't found mang."

There's more (notice, not "theres") but we'll (notice, not "well") let the balance go. We'll learn yuz real good in time.

<slappedwithsoggydishrag.mpg>

Ban me, ban me!

grush

  • Guest
Basic lisp help needed
« Reply #7 on: February 16, 2005, 11:31:38 AM »
Quote from: CmdrDuh
What version of Acad do you have?  I dont have a Dline, but I do have a Mline.

(defun c:DrawWall ()
  (setvar "clayer" "Wall")
  (COMMAND "mline" "s" "6")
)

OR THIS MIGHT WORK
(defun c:DrawWall ()
  (setvar "clayer" "Wall")
  (COMMAND "dline" "w" "6")
)


I'm running 2004. The dline is from R11 (I think). It was giving me some problems when trying to write a macro. I forgot the error I was getting.

grush

  • Guest
Basic lisp help needed
« Reply #8 on: February 16, 2005, 11:35:01 AM »
Dline lisp for anyone who wants it:


<Code removed>

grush,
I removed the code as it was incomplete. You may have exceeded the max post size.
If you wand to post a large routine, try uploading it as a file to the lilly pond
http://theswamp.org/lilly_pond
You can then post a link to your uploaded file.
-= CAB =-

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Basic lisp help needed
« Reply #9 on: February 16, 2005, 11:39:33 AM »
*sigh* I hate you.

Ive heard that Albert Einstein wasn't that good of a speller. Now, I'm not trying to imply anything, but...
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

<spell check police>

  • Guest
Basic lisp help needed
« Reply #10 on: February 16, 2005, 11:44:13 AM »
We're just here to help, wish us away and it will be so.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Basic lisp help needed
« Reply #11 on: February 16, 2005, 11:46:34 AM »
Quote from: Se7en
I dont have a dline command either. *shrug*

For what its worth, Here is my version.
Code: [Select]

(defun c:MyButtonReplacement ( / layer?)
  ;; Suport procedure
  ;; it will test to see if a layer exists
   (defun layer? (n) (and (tblsearch "LAYER" n)))
  ;; Test to see if layer exists in drawing
 (cond
   ((layer? "Wall")
   ;; if it does then set it to the current layer
    (setvar "clayer" "Wall")
   ;; and start the mline command
    (command "mline" "s" "6")
    )
   ;; otherwise Inform the use that the layer dosnet exist.
   (T
     "Layer dosnet exist"
     )
   )
 )

What happens if the layer is frozen? 8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Basic lisp help needed
« Reply #12 on: February 16, 2005, 11:48:18 AM »
I was only trying to give him what he had in the menu.  It sould be further error checked for sure.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Basic lisp help needed
« Reply #13 on: February 16, 2005, 11:50:03 AM »
Quote from: CAB
What happens if the layer is frozen? 8)


The it crashes.  ...Come on CAB follow along. :D

(What do you want? A full blown app?)

:P
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

<spell check police>

  • Guest
Basic lisp help needed
« Reply #14 on: February 16, 2005, 12:13:26 PM »
Hey I heard that ... *poof*

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Basic lisp help needed
« Reply #15 on: February 16, 2005, 12:40:10 PM »
heard what?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org