Author Topic: Break circle  (Read 2470 times)

0 Members and 1 Guest are viewing this topic.

Jimmy D

  • Guest
Break circle
« on: April 05, 2005, 01:46:21 AM »
Hi,

Is it possible to break a circle and not remove the selected section?
I have this routine to create hidden lines (works like a trim command,
only it doesn't trim but changes the objects into hidden lines) but it
doesn't work with circles.

Thanks,
Jim

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Break circle
« Reply #1 on: April 05, 2005, 08:24:30 AM »
You should check this out:
http://www.theswamp.org/phpBB2/viewtopic.php?p=51602#51602

I'm still working on some revisions but the routine posted works well.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jimmy D

  • Guest
Break circle
« Reply #2 on: April 05, 2005, 09:55:37 AM »
Thank you Cab, I see how I can go on now.

This is what I have so far (sorry, comments are in Dutch).
Still have to add the circle bit..
Routine works for nearly all types of objects, didn't test it though.
Some parst (getthepoints) are from Juerg.



Code: [Select]
;//Functie voor het automatisch genereren van verborgen lijnen
;//Selecteer de omtrekslijnen die zichtbaar zijn
;//Selecteer dan de lijnen die verborgen moeten worden
;//Het selectiepunt heeft aan welke zijde verborgen moet zijn
;//
;//Gemaakt 31-03-2005
;//
;//GetThePoints thanks to Juerg Menzi
;//
;//
;//
;//
(defun c:JD_TRIM( / selfirst selsecond carselsecond selectpoint breakpoint
                   count intersectlist cutlinelist *error*)
(vl-load-com)
;---------------------------------------
;Error handling
;---------------------------------------
(defun *error* (msg)
     (princ "\nError: ")
     (rdraw CutLineList 4)
     (setvar "OSMODE" OldOsmode)
     (setvar "CMDECHO" OldEcho)
     (princ))
;---------------------------------------
;Basis instellingen
;---------------------------------------
(setq OldOsmode (getvar "OSMODE")
      OldEcho (getvar "CMDECHO"))
(setvar "OSMODE" 0)
(setvar "CMDECHO" 0)
(if (= (tblsearch "layer" "35h") nil)
    (entmake '((0 . "LAYER")(100 . "AcDbSymbolTableRecord")(100 . "AcDbLayerTableRecord")(2 . "35h")(70 . 0)
    (62 . 1)(6 . "HIDDEN"))))
;---------------------------------------
;Highlight snijlijnen aan/uit (ssgetlijst als ents /
;3 of 4 als HLMode (3 = highlight on / 4 = highlight off)
;---------------------------------------
(defun RDraw (Ents HLMode / CNT )
(setq CNT 0)
(repeat (sslength Ents)
(redraw (ssname Ents cnt) HLMode)
(setq CNT (+ CNT 1))))
;---------------------------------------
;Zoek alle snijpunten per 2 objecten (entfirst entsecond)
;---------------------------------------
(defun GetThePoints (EntFirst EntSecond / IntersectPnt IntersectValue) ;;Bepaal de snijpunten tussen 2 objecten..
(setq EntFirst (vlax-ename->vla-object SelFirst)
      EntSecond (vlax-ename->vla-object carSelSecond)
      IntersectPnt (vla-intersectwith EntFirst EntSecond acExtendNone)
      IntersectValue (vlax-variant-value IntersectPnt)
      IntersectList nil)
      (if (safearray-value IntersectValue)
          (setq IntersectList (vlax-safearray->list IntersectValue))
      );end if
);end defun GetThePoints ;; en zet de snijpunten in de lijst IntersectList...
;---------------------------------------
;Maken van de basisselectie
;---------------------------------------
(princ "\nPlaatsen van verborgen lijnen...")
(princ "\nSelecteer de snijlijnen...")
(setq CutLineList (ssget '((0 . "LINE,POLYLINE,LWPOLYLINE,ARC,CIRCLE,SPLINE,ELLIPSE,RAY,XLINE"))))
(rdraw CutLineList 3)
(setq SelSecond (entsel "\nSelecteer het eerste object om te verbergen..."))
(setq carSelSecond (car SelSecond))
(setq SelectPoint (cadr SelSecond))
;---------------------------------------
;doorlopen van de selectie en aanpassen indien nodig
;---------------------------------------
   (while (/= Selsecond nil)
     (if (= (cdr (assoc 0 (entget carselsecond))) "CIRCLE")
     (alert "Een Circle-Object kan niet gebroken worden.")
     (progn
       (setq Count 0)
         (repeat (sslength CutlineList)
                 (setq Selfirst (ssname CutLineList Count))
                 (GetThePoints SelFirst carSelSecond)
                  (repeat (/ (length IntersectList) 3)
                     (setq BreakPoint (list (car Intersectlist)(cadr Intersectlist)(caddr Intersectlist)))
                     (command "._break" carSelSecond  Breakpoint Breakpoint)
                     (setq Intersectlist (cdddr Intersectlist))
                     (setq carSelSecond (ssname (ssget SelectPoint) 0))
                   );end repeat
          (setq Count (+ Count 1))
        );end repeat
   (command "change" SelectPoint "" "p" "la" "35h" "")
   ));end progn end if
   (setq SelSecond (entsel "\nSelecteer het volgende object om te verbergen..."))
   (setq carSelSecond (car SelSecond))
   (setq SelectPoint (cadr SelSecond))
   );end while (/= nil Selsecond)
;---------------------------------------
;basisinstellingen terug zetten en publiek danken :)
;---------------------------------------
(rdraw CutLineList 4)
(setvar "OSMODE" OldOsmode)
(setvar "CMDECHO" OldEcho)
(princ "\nDank u voor gebruik te maken van deze tool   -   J. D'Hondt ")
(princ));end defun c:defun