Author Topic: need lisps  (Read 25537 times)

0 Members and 1 Guest are viewing this topic.

M-dub

  • Guest
need lisps
« Reply #15 on: November 11, 2003, 09:18:37 AM »
This one might help you for No.'s 3 & 4, but you'll have to do a LITTLE bit of the work yourself... :wink:
I added this one to my right click menu definition and put it in my Startup Suite...I use it ALL the time!

I can't remember who gave it to me originally...could have been one of you guys from Cadalog...

Code: [Select]
(defun c:btwn (/ PT1 PT2)
  (setq PT1
    (getpoint "\nEnter first point:")
  )
  (setq PT2
    (getpoint "\nEnter second point:")
  )
  (polar PT1
    (angle PT1 PT2)
    (/ (distance PT1 PT2) 2)
  )
); end btwn.lsp

ELOQUINTET

  • Guest
need lisps
« Reply #16 on: November 11, 2003, 09:45:49 AM »
i believe we've had this conversation before or i've seen the post where you got btwn. my question is how would i add this to my right click definition, haven't tried that yet. so if i was to add this then i could do mirror then right click and set my baspoint as midway between 2 paraleel lines. do i understand you correctly. if so help me out with that. thank ya

dan

M-dub

  • Guest
need lisps
« Reply #17 on: November 11, 2003, 10:02:42 AM »
In your menu file, look for
//   Begin AutoCAD Pull-down Menus
//
***POP0
**SNAP
and add ID_OsnapBtwn [&Between]_'btwn in there somewhere...I put mine under the Midpoint entry.
Make sure you have that lisp in your startup stuite though so it loads with each drawing.
Give that a try and let me know if that was what you were looking for.
Good Luck,
Mike

ELOQUINTET

  • Guest
need lisps
« Reply #18 on: November 11, 2003, 10:08:22 AM »
hey mdub i  understand what you're saying but how do i get it so if i start a command like say line that i have osnaps when i right click. right now i just have enter, cancel, pan and zoom. i went to options/right click but it didn't help????

dan

daron

  • Guest
need lisps
« Reply #19 on: November 11, 2003, 10:11:44 AM »
Quote from: eloquintet
where do you think it would be. i don't see it in my toolbars pulldown or in my express folder? thanks man

dan


You can find it in Express->modify->extended offset, or type exoffset. You should be able to see.

M-dub

  • Guest
need lisps
« Reply #20 on: November 11, 2003, 10:13:01 AM »
I think it should work if you only have Windows Standard Accelerator Keys checked.
Try that...??

M-dub

  • Guest
need lisps
« Reply #21 on: November 11, 2003, 10:14:06 AM »
Actually, it might be CTRL+Right Click to get your osnap menu...

ELOQUINTET

  • Guest
need lisps
« Reply #22 on: November 11, 2003, 10:23:21 AM »
ah that's it i had remembered i had that in the past but forgot you have to hold down control, got it. thanks

dan

ELOQUINTET

  • Guest
need lisps
« Reply #23 on: November 11, 2003, 10:35:34 AM »
mdub i did what you said but it's not showing up in my shortcut menu?

ID_OsnapEndp [&Endpoint]_endp
ID_OsnapMidp [&Midpoint]_mid
ID_Osnapbtwn [&Between]_'btwn
ID_OsnapInte [&Intersection]_int
ID_OsnapAppa [&Apparent Intersect]_appint
ID_OsnapExte [E&xtension]_ext

what's the matter?

dan

M-dub

  • Guest
need lisps
« Reply #24 on: November 11, 2003, 10:40:06 AM »
Did you reload your menu?

If not, be careful!  If you've added custom toolbars in AutoCAD (as opposed to adding them to the acad.mnu), you'll lose them unless you copy the definitions from acad.mns to acad.mnu.
Before you try this, save a copy of acad.mns as acadmns.old or something like that...just in case.

ELOQUINTET

  • Guest
need lisps
« Reply #25 on: November 11, 2003, 10:57:24 AM »
crap i saved it somewhere else but didn't change the name it blew away everything. i moved the ones i copied back into support and replaced but don't have any of my custom stuff now. i'm not sure if it's worth the time it would time me to recreate it. how can i incorporate this small change without blowing away everything? or recover my old menu file?

dan

M-dub

  • Guest
need lisps
« Reply #26 on: November 11, 2003, 11:07:57 AM »
Dan, Dan, Dan... :cry:
I feel your pain.  If you didn't save it in a different diretory, I have some good news and some bad news...
First, the bad:
You're S.O.L. -

**********Stop The Press**********
Quote
crap i saved it somewhere else but didn't change the name it blew away everything. i moved the ones i copied back into support and replaced but don't have any of my custom stuff now.

You may be in luck...Now that you've moved the mns file back, open it up and do a search for your toolbars.  Search for the name of each.  If you find them, COPY THEM INTO YOUR MNU FILE!!!
Doing this will eliminate the possibility of blowing them away in the future.

First of all, have I got everything straight so far?

ELOQUINTET

  • Guest
need lisps
« Reply #27 on: November 11, 2003, 11:24:22 AM »
hey when i copied them i didn't see any .mns file. what i copied was the .mnl and .mnr files. i'm kind of screwed but not completely because i have some of this custom stuff done at home i think. is there a better way to do this so in the future i don't get screwed?

dan

M-dub

  • Guest
need lisps
« Reply #28 on: November 11, 2003, 11:42:11 AM »
There IS an MNS file...I'm tellin' ya!
Someone correct me if I'm wrong, but I don't think it's possible NOT to have one.

Anyway, if you want to simply add something to your menu to test, add it to the mns file.  When you're confident that it works, go copy it to your mnu file.  Make sure you've copied EVERYTHING you've added to the mns.  The toolbars you create while in AutoCAD (command: customize) are saved in the mns file which is overwritten by whatever is in the mnu file when you reload it.  If your toolbar definitions are copied into the mnu file, you're safe.

Quote from: AutoCAD Help File
NOTE If you use the interface to modify the toolbars, you should cut and paste the modified portions of the MNS file to the MNU file before deleting the MNS file.


I don't think I did a very good job of explaining this...Can someone lend a hand?

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
need lisps
« Reply #29 on: November 11, 2003, 11:43:31 AM »
#2
Code: [Select]

;;; draw line between midpoint of two paralell lines
(defun midpt (p1 p2)
  (mapcar
    '(lambda (x y) (/ (+ x y) 2.0)) p1 p2)
  )
;
;   ,-----------------------------------------------,
;   |                MAIN FUNCTION                  |
;   '-----------------------------------------------'
;
(defun c:lbmp (/ line1 line2 mpt1 mpt2)

  (if (setq line1 (entsel "\nSelect 1st Line: "))
    (progn
      (setq line1 (entget (car line1)))
      (if (setq line2 (entsel "\nSelect 2nd Line: "))
        (setq line2 (entget (car line2)))
        )
      )
    )

  (if
    ;; make sure they are both lines
    (and
      (= (cdr (assoc 0 line1)) "LINE")
      (= (cdr (assoc 0 line2)) "LINE")
      )
    (if
      ;; make sure they are paralell
      (equal
        (angle (cdr (assoc 10 line1)) (cdr (assoc 11 line1)))
        (angle (cdr (assoc 10 line2)) (cdr (assoc 11 line2)))
        )
      (progn
        (setq mpt1
              (midpt (cdr (assoc 10 line1))
                     (cdr (assoc 11 line1))
                     )
              mpt2
              (midpt (cdr (assoc 10 line2))
                     (cdr (assoc 11 line2))
                     )
              )
        ;; create the line
        (entmake
          (list
            '(0 . "LINE")
            (cons 10 mpt1)
            (cons 11 mpt2)
            )
          )
        ) ; progn
      ; else
      (prompt "\nLines are not paralell")
      ) ; if
    ; else
    (prompt "\nOne of the selected entities is not a line")
    )
  (princ)
  )
TheSwamp.org  (serving the CAD community since 2003)