Author Topic: break and hide lisp needs improvement  (Read 2314 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
break and hide lisp needs improvement
« on: April 20, 2005, 10:45:51 AM »
i am trying to use this lisp to break and hide lines. when we do reflected details we hide part of our mounting bracket under a fascia. the bracket is a block and the fascia varies in size. it has two main problems. first it doesn't work on blocks and second when i hide the line which is the leg of the angle it goes to the corner insted of remaining straight. this block will be a dynamic block project in the future but until then i need an affective break and hide lisp. can anybody help me out please. here what i have:

Code: [Select]
;;CADALYST 01/04 Tip1919: BKH.LSP  Break and Hide (c) 2004 J.D. Henman

;;; 20031002 JDH BKH.LSP
;;; For breakout of arcs & lines and inserting hidden replacement
;;; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(defun c:HDN (/ oclayer)
  (setq oclayer (getvar "clayer"))
  (command "layer" "m" "HIDDEN" "c" "9" "" "lt" "hidden" "" "")
  (setvar "clayer" oclayer)
) ;defun

(defun c:BKH (/ oclayer olsnap bobj bobj2 bobytyp pt1 pt2 pt3 bobjcen rdist)
  ;;
  (C:hdn)
  ;;
  (setq oclayer (getvar "clayer"))
  (setq olsnap (getvar "osmode"))
  (setvar "osmode" 127)
  (setq bobj (entsel "\n Select Line, Polyline, Circle or Arc to Break: "))
  (setq bobj2 (assoc 0 (entget (car bobj))))
  (setq bobjtyp (cdr bobj2))
  (if ( or (= bobjtyp "LINE")(= bobjtyp "LWPOLYLINE") (= bobjtyp "POLYLINE"))
    (progn
      (setvar "osmode" 127)
      (setq pt2 (getpoint "\nSelect First Intersection. "))
      (setq pt3 (getpoint "\nSelect Second Intersection. "))
      (command "break" bobj "_f" pt2 pt3)
      (setvar "clayer" "HIDDEN")
      (setvar "osmode" 127)
      (command "line" pt2 pt3 "")
      (setvar "osmode" olsnap)
      (setvar "clayer" oclayer)
    ) ;progn
    (if (or (= bobjtyp "CIRCLE") (= bobjtyp "ARC"))
      (progn
(princ "\nsee here")
(setvar "osmode" 127)
(setq pt2 (getpoint "\nSelect First Intersection. "))
(setq pt3 (getpoint "\nSelect Second Intersection. "))
(setq bobjcen (assoc 10 (entget (car bobj))))
(setq pt1 (cdr bobjcen))
(setq rdist (distance pt1 pt2))
(command "break" bobj "_f" pt2 pt3)
(setvar "clayer" "HIDDEN")
;(setvar "osmode" 127)
(setvar "osmode" olsnap)
(command "arc" "C" pt1 pt2 pt3)
(setvar "osmode" olsnap)
(setvar "clayer" oclayer)
      ) ;progn
      (princ "\n   Arc, Circle, Polyline or Line not selected")
    ) ;if
  ) ;if
  (princ)
) ;defun

ELOQUINTET

  • Guest
break and hide lisp needs improvement
« Reply #1 on: April 21, 2005, 01:53:53 PM »
Have i become invisible ??? :cry:

daron

  • Guest
break and hide lisp needs improvement
« Reply #2 on: April 21, 2005, 03:05:37 PM »
Who, What, Where... Sorry, It's just I didn't really have time to look into it and I don't usually like sorting through setvar's to find the problem. Why don't you try to find where there is an issue and see if you can't figure it out yourself or at least let us know what point needs to be focused on so we can give you something.

ELOQUINTET

  • Guest
break and hide lisp needs improvement
« Reply #3 on: April 21, 2005, 05:30:08 PM »
the main problem i have with it daron is that it does not work on blocks which is what i need it for at the moment so that would be a major improvement. so you think the line may be jumping to the endpoint because of my osnap settings? i'll play around with it maybe this weekend. i'm in the process of packing right now for a move at the end of the month so don't have alot of spare time and can't find anything if i did so... we'll see.

daron

  • Guest
break and hide lisp needs improvement
« Reply #4 on: April 22, 2005, 07:11:36 AM »
Lookup entsel and nentsel in the help files and see if changing entsel to nentsel will help you.