Author Topic: Anyone have an Isometric Fillet lsp?  (Read 4775 times)

0 Members and 1 Guest are viewing this topic.

BazzaCAD

  • Guest
Anyone have an Isometric Fillet lsp?
« on: May 23, 2007, 02:45:03 PM »
I've found one via google, but it only works on <Isoplane Top>, I also need it to work on the side planes or whatever my current SNAPISOPAIR is set to...
I know I could do it my self, but with a deadline fast approaching & with a lots of ISO details to draft, I don't have the time right now.
Any help would be much appreciated.

thx,
Barry

lispman21

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #1 on: May 23, 2007, 03:21:43 PM »
I believe this is what your looking for.

Code: [Select]
(DEFUN cent (a b / dist ang mid)
  (SETQ dist (/ (DISTANCE a b) 2))
  (SETQ ang (ANGLE a b))
  (SETQ mid (POLAR a ang dist))
)
(DEFUN dxf (code elist)
  (CDR (ASSOC code elist))
)
(DEFUN c:isof (/ a b   pa    pb     na
       nb bega begb   holdsnapstyl     enda
       endb a10 a11   b10    b11     pt
       center tanga tangb   trmla    trmlb    holdosmode
       holdsnapisopair holdrad  el    ellt     anga
       angb angaa angbb
      )
  (SETQ holdosmode (GETVAR "OSMODE"))
  (SETQ holdsnapstyl (GETVAR "snapstyl"))
  (SETVAR "cmdecho" 0)

  (SETQ radius nil)
(While (= radius nil)
   (SETQ radius (getreal "Enter Radius for Fillet: "))
);; end of While

   (SETQ a (ENTSEL (STRCAT "\nSelect first line for Radius <"
  (RTOS radius 2 3)
  ">: ")
  )
   )

  (SETQ b (ENTSEL "\nSelect second line: "))
  (SETQ holdsnapisopair (GETVAR "snapisopair"))
  (SETQ holdrad (GETVAR "FILLETRAD"))
  (SETVAR "FILLETRAD" 0)
  (SETVAR "OSMODE" 0)
  (SETQ pa (CADR a))
  (SETQ na (CAR a))
  (SETQ pb (CADR b))
  (SETQ nb (CAR b))
  (COMMAND "_.fillet" pa pb)
  (COMMAND "_.select" pa "")
  (SETQ na (SSNAME (SSGET "p") 0))
  (COMMAND "_.select" pb "")
  (SETQ nb (SSNAME (SSGET "p") 0))
  (SETQ a10 (dxf 10 (ENTGET na)))
  (SETQ a11 (dxf 11 (ENTGET na)))
  (SETQ b10 (dxf 10 (ENTGET nb)))
  (SETQ b11 (dxf 11 (ENTGET nb)))
  (SETQ pt (INTERS a10 a11 b10 b11 nil))
  (IF (> (DISTANCE pt a10) 1E-10)
    (SETQ bega a11
  enda a10
    )
    (SETQ bega a10
  enda a11
    )
  )
  (IF (> (DISTANCE pt b10) 1E-10)
    (SETQ begb b11
  endb b10
    )
    (SETQ begb b10
  endb b11
    )
  )
  (SETQ anga   (ANGLE bega enda)
angb   (ANGLE begb endb)
tanga  (POLAR bega anga (SETQ diamet (* 2 radius)))
tangb  (POLAR begb angb (* 2 radius))
trmla  (POLAR bega anga radius)
trmlb  (POLAR begb angb radius)
center (cent tanga tangb)
trima  (LIST na bega)
trimb  (LIST nb begb)
  )
  (SETQ angaa (ANGTOS anga))
  (SETQ angbb (ANGTOS angb))
  (SETVAR "snapstyl" 1)
  (SETVAR "snapisopair" 1)
  (COMMAND ".ellipse" "i" center radius)
  (IF (OR (AND (= angaa "150") (= angbb "90"))
  (AND (= angaa "90") (= angbb "150"))
  (AND (= angaa "90") (= angbb "330"))
  (AND (= angaa "330") (= angbb "90"))
  (AND (= angaa "270") (= angbb "150"))
  (AND (= angaa "150") (= angbb "270"))
  (AND (= angaa "270") (= angbb "330"))
  (AND (= angaa "330") (= angbb "270"))
      )
    (COMMAND "_.rotate" (ENTLAST) "" center "120")
  )
  (IF (OR (AND (= angaa "270") (= angbb "30"))
  (AND (= angaa "30") (= angbb "270"))
  (AND (= angaa "210") (= angbb "270"))
  (AND (= angaa "270") (= angbb "210"))
  (AND (= angaa "210") (= angbb "90"))
  (AND (= angaa "90") (= angbb "210"))
  (AND (= angaa "90") (= angbb "30"))
  (AND (= angaa "30") (= angbb "90"))
      )
    (COMMAND "_.rotate" (ENTLAST) "" center "-120")
  )
  (SETQ el   (ENTLAST)
ellt (LIST el endb)
  )
  (COMMAND ".line" trmla trmlb "")
  (COMMAND "trim" "l" "" trima trimb ellt "")
  (COMMAND "erase" "p" "")
  (COMMAND "redraw")
  (SETVAR "snapstyl" holdsnapstyl)
  (SETVAR "snapisopair" holdsnapisopair)
  (SETVAR "FILLETRAD" holdrad)
  (SETVAR "OSMODE" holdosmode)
  (PRINC)
)
(PRIN1)
(PROMPT "\nType ISOF to envoke the command")
« Last Edit: May 23, 2007, 03:36:38 PM by lispman21 »

BazzaCAD

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #2 on: May 23, 2007, 05:18:45 PM »
YA that's basically the same version I found, but it still doesn't work for the side planes....
See screen shot.
Does it work for you?
Maybe it's relaying on a setting I've changed.....

lispman21

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #3 on: May 24, 2007, 09:54:47 AM »
It seems to work on any 2 line i select in an ISO.  It very well could be a setting that has been changed, but i am not positive what it would be.

LUCAS

  • Newt
  • Posts: 32
Re: Anyone have an Isometric Fillet lsp?
« Reply #4 on: May 29, 2007, 01:05:33 AM »
Code: [Select]
(defun CENT (A B / DIST ANG MID)
  (setq DIST (/ (distance A B) 2))
  (setq ANG (angle A B))
  (setq MID (polar A ANG DIST))
)

(defun DXF (CODE ELIST)
  (cdr (assoc CODE ELIST))
)

(defun C:ISOF (/ A B   PA    PB     NA
       NB BEGA BEGB   HOLDSNAPSTYL     ENDA
       ENDB A10 A11   B10    B11     PT
       CENTER TANGA TANGB   TRMLA    TRMLB    HOLDOSMODE
       HOLDSNAPISOPAIR HOLDRAD  EL    ELLT     ANGA
       ANGB ANGAA ANGBB
      )
  (setq HOLDOSMODE (getvar "OSMODE"))
  (setq HOLDSNAPSTYL (getvar "snapstyl"))
  (setvar "cmdecho" 0)
  (if (= RADIUS NIL)
    (setq RADIUS 1)
  )
  (setq RADD RADIUS)
  (setq A (entsel (strcat "\n<Select first line>/RETURN for Radius<"
  (rtos RADIUS 2 8)
  ">: "
  )
  )
  )
  (while (null A)
    (prompt
      (strcat "\nEnter Iso_fillet radius <"
      (rtos RADIUS 2 8)
      ">: "
      )
    )
    (setq RADIUS (getdist))
    (if (= RADIUS NIL)
      (setq RADIUS RADD)
    )
    (setq
      A (entsel (strcat "\n<Select first line>/RETURN for Radius<"
(rtos RADIUS 2 8)
">: "
)
)
    )
  )
  (setq B (entsel "\nSelect second line: "))
  (setq HOLDSNAPISOPAIR (getvar "snapisopair"))
  (setq HOLDRAD (getvar "FILLETRAD"))
  (setvar "FILLETRAD" 0)
  (setvar "OSMODE" 0)
  (setq PA (cadr A))
  (setq NA (car A))
  (setq PB (cadr B))
  (setq NB (car B))
  (command "_.fillet" PA PB)
  (command "_.select" PA "")
  (setq NA (ssname (ssget "p") 0))
  (command "_.select" PB "")
  (setq NB (ssname (ssget "p") 0))
  (setq A10 (DXF 10 (entget NA)))
  (setq A11 (DXF 11 (entget NA)))
  (setq B10 (DXF 10 (entget NB)))
  (setq B11 (DXF 11 (entget NB)))
  (setq PT (inters A10 A11 B10 B11 NIL))
  (if (> (distance PT A10) 1E-10)
    (setq BEGA A11
  ENDA A10
    )
    (setq BEGA A10
  ENDA A11
    )
  )
  (if (> (distance PT B10) 1E-10)
    (setq BEGB B11
  ENDB B10
    )
    (setq BEGB B10
  ENDB B11
    )
  )
  (setq ANGA   (angle BEGA ENDA)
ANGB   (angle BEGB ENDB)
TANGA  (polar BEGA ANGA (setq DIAMET (* 2 RADIUS)))
TANGB  (polar BEGB ANGB (* 2 RADIUS))
TRMLA  (polar BEGA ANGA RADIUS)
TRMLB  (polar BEGB ANGB RADIUS)
CENTER (CENT TANGA TANGB)
TRIMA  (list NA BEGA)
TRIMB  (list NB BEGB)
  )
  (setq ANGAA (angtos ANGA))
  (setq ANGBB (angtos ANGB))
  (setvar "snapstyl" 1)
  (setvar "snapisopair" 1)
  (command ".ellipse" "i" CENTER RADIUS)
  (if (or (and (= ANGAA "150") (= ANGBB "90"))
  (and (= ANGAA "90") (= ANGBB "150"))
  (and (= ANGAA "90") (= ANGBB "330"))
  (and (= ANGAA "330") (= ANGBB "90"))
  (and (= ANGAA "270") (= ANGBB "150"))
  (and (= ANGAA "150") (= ANGBB "270"))
  (and (= ANGAA "270") (= ANGBB "330"))
  (and (= ANGAA "330") (= ANGBB "270"))
      )
    (command "_.rotate" (entlast) "" CENTER "120")
  )
  (if (or (and (= ANGAA "270") (= ANGBB "30"))
  (and (= ANGAA "30") (= ANGBB "270"))
  (and (= ANGAA "210") (= ANGBB "270"))
  (and (= ANGAA "270") (= ANGBB "210"))
  (and (= ANGAA "210") (= ANGBB "90"))
  (and (= ANGAA "90") (= ANGBB "210"))
  (and (= ANGAA "90") (= ANGBB "30"))
  (and (= ANGAA "30") (= ANGBB "90"))
      )
    (command "_.rotate" (entlast) "" CENTER "-120")
  )
  (setq EL   (entlast)
ELLT (list EL ENDB)
  )
  (command ".line" TRMLA TRMLB "")
  (command "trim" "l" "" TRIMA TRIMB ELLT "")
  (command "erase" "p" "")
  (command "redraw")
  (setvar "snapstyl" HOLDSNAPSTYL)
  (setvar "snapisopair" HOLDSNAPISOPAIR)
  (setvar "FILLETRAD" HOLDRAD)
  (setvar "OSMODE" HOLDOSMODE)
  (princ)
)

BazzaCAD

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #5 on: May 29, 2007, 06:47:12 PM »
Thx, but not much better...

LE

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #6 on: May 29, 2007, 06:55:20 PM »
Are you doing your isometrics in 2D?

BazzaCAD

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #7 on: May 29, 2007, 06:59:16 PM »
Yes of course...  :-)

LE

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #8 on: May 29, 2007, 07:07:24 PM »
I have my own ISOTOOLS commands, but not here in my office, I don't use them anymore, let me know if you would like to try them, in case of that, I need to make a compilation, for you personal use.

The commands will allow you to even work with 3D objects drawn at plan view, and insert them in the right isometric view... plus many other features.

BazzaCAD

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #9 on: May 29, 2007, 07:13:52 PM »
Thx ya some more ISO tools would be helpful, 3D would be even cooler.

On the ISOF.lsp bug, I think I'm stating to track it down. I started a new blank dwg from the Acad.dwt template & now it works fine. So it's a setting saved in my dwg that's screwing it up. It's none of the GET\SETVARS in the lsp because I've checked and they're both the same. I'll compare the other setting to try to figure out what it can be. If anyone has any other ideas, let me know.

BazzaCAD

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #10 on: May 29, 2007, 07:25:39 PM »
OK found it. My AUPREC was set to 2. The default is 0, I don't know how it got changed, or why or what it does.

From the help file:
Quote
Sets the number of decimal places for all read-only angular units displayed on the status line, and for all editable angular units whose precision is less than or equal to the current AUPREC value. For editable angular units whose precision is greater than the current AUPREC value, the true precision is displayed.

LE

  • Guest
Re: Anyone have an Isometric Fillet lsp?
« Reply #11 on: May 30, 2007, 12:11:05 AM »
Thx ya some more ISO tools would be helpful, 3D would be even cooler.

OK, appears that you have solved your problem, and for now I was able just to put together a lisp routine, that does the iso fillet, see if works for you (sorry, my code of isotools is not updated, and requires a lot of code time).

Edit: OK, the routine is now here:

http://www.theswamp.org/index.php?topic=9441.msg203648#msg203648
« Last Edit: May 30, 2007, 04:09:09 PM by LE »