Fancy 3D lsp needing update..................................TIA

Discussion in 'AutoCAD' started by Boll Weevil, Mar 24, 2005.

  1. Boll Weevil

    Boll Weevil Guest

    Boys and girls, I am just switching to Acad 2005 from Acad 14. I held out as
    long as I could (another story, another day). I do a lot of 3D modeling and
    there are some LSP routines which I can not live without. Since switching over
    some of my custom LSPs do not work. The two I've posted are a few of my
    favorites. I am no LSP expert so please help me out. Thanx.

    ;Draws 3Dface with 2 points
    ;**********************************************
    (defun C:ff ()
    (setq P1 (GETPOINT "Select point 1...")
    P2 (GETPOINT P1 "Select point 2..."))
    (command "3dface" P1 ".x" P2 P1 P2 ".x" P1 P2 "")
    (princ))

    ;THIS WILL MATCH THICKNESS OF A LINE FROM A SOURCE LINE
    ;**********************************************
    (DEFUN C:TH (/ INPUT1)
    (princ "\nChange object's thickness ... ")(princ "\nSelect objects: ")
    (command "select" "auto" pause)(setq pick(ssget "p"))
    (princ "\nEnter new Thickness or Pick an object: ")
    (setq chlaypt 'T name nil inchr nil instring1 "" ostr "" done nil)
    (while(not done)(setq input1(grread)n 0 newstr "")
    (cond((or(equal input1 '(2 32))(equal input1 '(6 0))
    (equal input1 '(2 13)))(setq done 'T))((equal input1 '(2 8))
    (setq ostr(substr ostr 1(1-(strlen ostr))))
    (princ "\n ")(princ "\n ")(princ "\n ")(princ ostr))((=(car input1)2)
    (setq newstr(chr(cadr input1))))((and chlaypt(=(car input1)3))
    (setq ent(ssget(osnap(cadr input1)"near,endp,int,cen,ins")))
    (if(null ent)(setq ent(ssget)))(setq ent(ssname ent 0))
    (setq name(cdr(assoc 39(entget ent))))
    (setq ostr "" done 't)(if(null name)(setq name 0.0))))
    (if(and newstr(not(equal newstr '(2 8))))(setq ostr(strcat ostr newstr)))
    (princ newstr))(princ " ")(if(/= ostr "")(setq name ostr))
    (if name(progn(command "change" pick "" "p" "t" name "")
    (if(=(type name)'STR)(princ(strcat "\nChanged to Thickness = " name))
    (princ(strcat "\nChanged to Thickness = "(rtos name))))))
    (setq pick nil ent nil name nil inchr nil instring1
    nil typ nil ostr nil chlaypt nil done nil)(gc)
    (princ))
     
    Boll Weevil, Mar 24, 2005
    #1
  2. Boll Weevil

    Paul Turvill Guest

    FF works fine for me.

    There's an extra character at the end of line 9 [ starts with (setq ostr
    ... ]
    in TH. After I removed it, TH also works OK.

    This is not the best code I've ever seen. Rather than nil out all those
    variables, it would make a lot more sense to just localize them so they'll
    be released automatically when the routines finish.
    ___
     
    Paul Turvill, Mar 25, 2005
    #2
  3. Boll Weevil

    longshot Guest

    You can't live without those lisps? they don't really do that much IMO
    one saves you a click or 2, the other can be accomplished with the MA (match
    prop) command
     
    longshot, Mar 25, 2005
    #3
  4. Boll Weevil

    Boll Weevil Guest

    Well, if you do these commands about 10,000 times per project if it save me a
    lot of clicks. Also, these may seem simple to you but to an analysis of the TH
    or FF command, they involve more than just two additional clicks:

    To do the TH command manually, you have to:
    The TH command save a lot more than just two clicks as you think.

    The FF command is more complicated since I use the command especially for roof
    tops. What you don't know about the FF command is that all the points of the
    polygons are automatically set on the same plane. This is especially why I like
    to use it. If you use the 3dface command, you can assign the points and they
    can all be on different Z values. This is not so good for roof plains.
     
    Boll Weevil, Mar 25, 2005
    #4
  5. Boll Weevil

    longshot Guest

    point taken
     
    longshot, Mar 26, 2005
    #5
  6. Boll Weevil

    Boll Weevil Guest

    Paul, thanx for the disection. This was what I was hoping someone would do for
    me.
     
    Boll Weevil, Mar 28, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.