+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Newbie
    Using
    AutoCAD 2005
    Join Date
    Jun 2007
    Posts
    5

    Default Lisp Routines Not Working in Current USC

    Registered forum members do not see this ad.

    We have many autocad drawings that have the building rotated at about 1.8 degree.

    When we xref the working file into our drawings, we use DDUCS and set to a view that was preset. This rotates the building so that all the walls are staright up and down and left and right. This makes it easier to draw our ductwork, text, etc.

    When we try to use our many lisp routines, they do not work, we get errors and things are no drawn the way they should. If we set the usc back to world, they work fine.

    How can get the lisp routine working, without rotating the building in the xref file.

    Thanks

  2. #2
    Super Member David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    1,925

    Default

    You can fix the routines, but it could be a daunting task. There are very many different scenarios that have to be addressed.

    i.e.

    If the program makes lines or various types of polylines via (entmake), all points are stored in WCS and group 210 must be specified. 210 is defaulted to WCS (0 0 1). Some dimension points also are WCS, some are UCS That could be a lot translating points.

    Some editing commands force the selected entity to be in the cuurent UCS.

    So every routine would have to be checked. -David
    R12 (Dos) - A2K

  3. #3
    Forum Newbie
    Using
    AutoCAD 2005
    Join Date
    Jun 2007
    Posts
    5

    Default

    Well,

    We have 100's of lisp routines, and we use a lot of the entget and getpoint to get various coordinates. We draw line and plines with the points

    I have copied a very simple routine that I wrote,

    So, I would have to modify this routine to something different,


    (defun cuctFitting-16 ()
    (SETQ OLDL (GETVAR "CLAYER"))
    (setq d1 nil)
    (graphscr)
    (setq pt1 (getpoint "\n.....Select Point To Insert Supply Diffuser.....: "))
    (PROMPT "\n.")
    (PROMPT "\n.")
    (setq w (getint "\n.....Enter the Width Of the Diffuser.....: "))
    (PROMPT "\n.")
    (PROMPT "\n.")
    (setq H (getint "\n.....Enter the Length Of the Diffuser.....: "))
    (PROMPT "\n.")
    (PROMPT "\n.")
    (setq D1 (getreal "\n.....Enter The Round Branch Duct Size....(inches)..... :"))

    (setq ang1 0)
    (setq ang2 (/ pi 2))
    (setq ang3 pi)
    (setq ang4 (* pi 1.5))
    (setq pt2 (polar pt1 ang2 w))
    (setq pt3 (polar pt2 ang1 h))
    (setq pt4 (polar pt1 ang1 h))
    (setq pt5 (polar pt2 ang1 (/ h 2)))
    (if (AND (/= W nil)(/= H nil))
    (progn
    (rgvlayr "M-HVAC-ATD" "6" "1")
    (setq A1 (strcat (ITOA (FIX d1)) "\042" "%%C"))
    (setq d2 (/ d1 2))
    (setq pt6 (polar pt5 ang1 (- d2 2)))
    (setq pt7 (polar pt5 ang1 (+ d2 2)))
    (setq pt8 (polar pt5 ang3 (- d2 2)))
    (setq pt9 (polar pt5 ang3 (+ d2 2)))
    (setq pt10 (polar pt1 ang2 (/ w 2)))
    (setq pt11 (polar pt10 ang1 (/ h 2)))
    (setq pt12 (polar pt11 ang1 d2))
    (setq pt13 (polar pt11 ang3 d2))
    (setq pt14 (polar pt11 ang2 d2))
    (setq pt15 (polar pt11 ang4 d2))
    (setq pt16 (polar pt7 ang4 1))
    (setq pt17 (polar pt9 ang4 1))
    (setq pt18 (inters pt1 pt3 pt7 pt16 nil))
    (setq pt19 (inters pt1 pt3 pt9 pt17 nil))
    (setq pt20 (inters pt2 pt4 pt7 pt16 nil))
    (setq pt21 (inters pt2 pt4 pt9 pt17 nil))
    (setq pt22 (polar pt12 ang2 w))
    (setq pt23 (polar pt13 ang2 w))
    (setq pt24 (polar pt11 ang2 (* w 0.75)))
    (command "zoom" pt1 pt3)
    (command "rectangle" pt1 pt3)
    (command "line" pt1 pt3 "")
    (command "line" pt2 pt4 "")
    ))

  4. #4
    Super Member David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    1,925

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by GMANSQUARE View Post
    (command "line" pt1 pt3 "")
    (command "line" pt2 pt4 "")
    ))

    Without doing any testing, my guess is that would you have to do this as a minimum:

    Code:
    (command "_.LINE" (trans pt1 1 0) (trans pt3 1 0) "")
    (command "_.LINE" (trans pt2 1 0) (trans pt4 1 0) "")
    (trans pt 1 0) = translate pt from current UCS (1) to WCS (0).
    -David
    R12 (Dos) - A2K

Similar Threads

  1. Looking for 2 lisp routines
    By Annabee in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 6th Aug 2007, 03:35 am
  2. LISP Routines
    By nickahughes in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 5th Mar 2007, 06:10 am
  3. LISP routines
    By mattwsp in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 5th Jul 2006, 09:41 am
  4. New lisp routines
    By good_m in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 6th Apr 2006, 03:56 pm
  5. Lisp routines
    By Chris in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 5th Nov 2005, 02:10 am

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