Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/09/2023 in all areas

  1. I would look at using a wipeout rather than a trim then your pline still exists but will look like its broken just make a polygon rather than a circle if you have a reasonable number of sides it will look like a circle. 20 sides
    2 points
  2. And why not apply a donut of white color and the circle of the color of the current layer? So in paper space or when printing it will look the same as if the polyline was adjusted. In addition you keep your polyline in one piece... (defun C:CC (/ coords ent rad) (initget 7) (setq rad (getdist "\nEnter radius: ")) (while (setq ent (entsel "\nSelect polyline (or press Enter to Exit) >> ")) (setq ent (car ent) coords (vl-remove-if 'not (mapcar (function (lambda (p) (if (= 10 (car p)) (cdr p)) ) ) (entget ent) ) ) ) (foreach pt coords (entmake (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") (cons 67 (if (eq (getvar "CVPORT") 1) 1 0)) (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model")) (cons 8 (getvar "CLAYER")) '(62 . 7) '(420 . 16777215) '(100 . "AcDbPolyline") '(90 . 2) '(70 . 1) (cons 43 rad) (cons 38 (getvar "ELEVATION")) (cons 39 (getvar "THICKNESS")) '(39 . 0.0) (cons 10 (trans (list (+ (car pt) (* 0.5 rad)) (cadr pt)) 1 0)) (cons 40 rad) (cons 41 rad) '(42 . 1.0) '(91 . 0) (cons 10 (trans (list (- (car pt) (* 0.5 rad)) (cadr pt)) 1 0)) (cons 40 rad) (cons 41 rad) '(42 . 1.0) '(91 . 0) '(210 0.0 0.0 1.0) ) ) (entmake (list '(0 . "CIRCLE") '(100 . "AcDbEntity") (cons 67 (if (eq (getvar "CVPORT") 1) 1 0)) (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model")) (cons 8 (getvar "CLAYER")) (cons 10 (trans pt 1 0)) (cons 40 rad) '(210 0.0 0.0 1.0) ) ) ) ) (princ) )
    2 points
  3. Not wanting the brain to atrophy over the holiday season. I thought to post a hatch pattern that I have called Trilobe-E. I expect others can make a hatch pattern faster with various tools, but I like to use Autocad and trigonometry (in a spread sheet). It was based on a unit sized hexagon. As the grid is a hexagonal one instead of an orthogonal one, the brain was given good exercise. I am posting the text of the file as well as the pattern file. *Trilobe-E, trilobe pattern 307.589089469,3,3,12.1236363414,0.1320676359,0.15069,-19.521625573 322.410910531,3.0919,2.8806,9.6409374243,-0.2287478555,0.15069,-11.2071266916 337.589089469,3.2113,2.7887,9.6409374243,0.2287478555,0.15069,-11.2071266916 352.410910531,3.3506,2.7312,12.1236363414,-0.1320676359,0.15069,-19.521625573 7.589089469,3.5,2.7113,12.1236363414,0.132067636,0.15069,-19.521625573 22.410910531,3.6494,2.7312,9.6409374243,-0.2287478555,0.15069,-11.2071266916 37.589089469,3.7887,2.7887,9.6409374243,0.2287478555,0.15069,-11.2071266916 52.410910531,3.9081,2.8806,7.5486792315,0.132067636,0.15069,-19.521625573 112.410910531,4,3,12.1236363414,-0.132067636,0.15069,-19.521625573 97.589089469,3.9425,3.1393,-9.6409374243,-0.2287478555,0.15069,-11.2071266916 82.410910531,3.9226,3.2887,9.6409374243,-0.2287478555,0.15069,-11.2071266916 67.589089469,3.9426,3.438,12.1236363414,0.132067636,0.15069,-19.521625573 52.410910531,4,3.5774,7.5486792315,0.132067636,0.15069,-19.521625573 37.589089469,4.0919,3.6968,9.6409374243,0.2287478555,0.15069,-11.2071266916 22.410910531,4.2113,3.7887,9.6409374243,-0.2287478555,0.15069,-11.2071266916 7.589089459,4.3506,3.8461,12.1236363414,0.132067636,0.15069,-19.521625573 67.589089469,4.5,3.866,12.1236363414,0.132067636,0.15069,-19.52162557 82.410910531,4.5575,4.0053,9.6409374243,-0.2287478555,0.15069,-11.2071266916 97.58908946,4.5774,4.1547,9.6409374243,0.2287478555,0.15069,-11.2071266916 112.410910531,4.5574,4.3041,12.1236363414,-0.132067636,0.15069,-19.52162557 127.589089469,4.5,4.4434,7.5486792315,-0.132067636,0.15069,-19.52162557 142.410910531,4.4081,4.5628,9.6409374243,-0.2287478555,0.15069,-11.2071266916 157.589089469,4.2887,4.6547,9.6409374243,0.2287478555,0.15069,-11.2071266916 172.410910531,4.1494,4.7121,7.5486792315,0.132067636,0.15069,-19.52162557 *eldon fecit MMXXIII Trilobe-E.pat
    1 point
  4. 2 ways : (setvar 'qaflags 1) (vl-cmdf "_.explode" ss) (setvar 'qaflags 0) But working with QAFLAGS is little risky - if not reset to 0, CAD behaves strange... (initcommandversion) (vl-cmdf "_.explode" ss) But this is somewhat not always good if (initcommandversion) function not available...
    1 point
  5. (vlax-invoke c_vlaobject 'getattributes) (vlax-invoke c_vlaobject 'getattributes) returns a list of objects. So you will have to loop though them to find the tagstings.
    1 point
  6. Ahh, have I got my answer the wrong way round by the way? I am trimming the circles and leaving the polyline as it was. Are you wanting to leave the circles and trimming the polyline Which the link will do just needs to think the other way round -EDIT- This will cut a polyline out of the circles as above picture, (defun C:CC (/ coords ent rad e t1) (defun MTR (e t1 p / l c) (command "TRIM" e "") (command (list t1 p)) (command "") ) (setq rad (getreal"\nEnter radius: ")) (while (setq ent (car (entsel "\nSelect polyline (or press Enter to Exit) >> "))) (setq t1 ent) (setq coords (vl-remove-if 'not (mapcar (function (lambda(p) (if (= 10 (car p))(cdr p)) )) (entget ent) ) ; end mapcar )) ; end setq, vl-remove-if (setq coords (reverse coords)) (foreach pt coords (command "_circle" "_non" pt rad) (setq e nil) (setq e (entlast)) (setq p (assoc 10 (entget e))) (setq p (list (cadr p) (caddr p) (cadddr p))) (command "TRIM" e "") (command (list t1 p)) (command "") ) ; end foreach ) ; end while (princ) )
    1 point
  7. Anyway, this might be as good starting point for you? https://autocadtips1.com/2012/03/08/autolisp-trim-objects-on-one-side/ I haven't tried this yet but if you make a selection set of the circles as you create them, to be variable t1 in this code, the polyline to be a selection set, e, and then you can use something like (setq p (osnap (vlax-curve-getStartPoint (entlast)) "gcen")) as the point p, side to trim on. However... I think this will only work if the polyline is a closed polyline - which should be OK to do, copy the existing polyline and call this new line a name (setq Polyinename (entlast)) - something like that. Something like this from Lee Mac (http://lee-mac.com/polylineprograms.html) will close a polyline. So with a closed polyline I think this should work. Trim the circles, delete this temporary polyline (which you can do since you were bullying calling it names). Errors might do strange things such as leaving the temporary polyline in place. For Devtigs question, what to do with the end circles, this will trim them as if the missing link in the polyline is there. If you want to do something else then don't add them to the polyline.. Right, kind of hoping you follow all of that?
    1 point
×
×
  • Create New...