Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/14/2023 in all areas

  1. I tried (entmod (subst (cons 42 1.57) (assoc 42 ent) ent)), ok when you do a check 42 is 1.57 but the text is not rotated same with using property 'TextRotation, it may be my Bricscad V20, I did read a comment that you have to reset the arrow head point, then it changes. I did notice that the end leader line point changes when you manually change the angle so I think that is the answer. Change more than one value. Now where is that landing point value hidden. One suggestion is to use setproperty will try it.
    1 point
  2. Let's start with selecting all blocks inside a closed polyline. Now I just print the list of (list insert_point blockname) of all the blocks inside. What data do you want in that csv? (Anyone, feel free to take it from here) (vl-load-com) (defun drawxRay (pt vec) (entmakex (list (cons 0 "RAY") (cons 100 "AcDbEntity") (cons 100 "AcDbRay") (cons 10 pt) (cons 11 vec)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Intersections - Lee Mac ;; http://www.lee-mac.com/intersectionfunctions.html ;; Returns a list of all points of intersection between two objects ;; for the given intersection mode. ;; ob1,ob2 - [vla] VLA-Objects ;; mod - [int] acextendoption enum of intersectwith method ;; acextendnone Do not extend either object ;; acextendthisentity Extend obj1 to meet obj2 ;; acextendotherentity Extend obj2 to meet obj1 ;; acextendboth Extend both objects (defun LM:intersections ( ob1 ob2 mod / lst rtn ) (if (and (vlax-method-applicable-p ob1 'intersectwith) (vlax-method-applicable-p ob2 'intersectwith) (setq lst (vlax-invoke ob1 'intersectwith ob2 mod)) ) (repeat (/ (length lst) 3) (setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn) lst (cdddr lst) ) ) ) (reverse rtn) ) ;; what this function does: from point pt we draw a RAY to the right. We detect intersections of the ray with the closed polyline. ;; => if the number of intersections is odd -> this means the point is inside the polygon, and the ray exits the polygon at the last intersection. ;; => if the number of intersections is even (0, 2, 4...) -> the point is outside the polygon. The ray doesn't intersect, or it enters then exits... (defun point_inside_closed_polyline (pt pline / ray ins) (setq ray (drawxRay pt (list 1.0 0.0))) (setq ins (LM:intersections (vlax-ename->vla-object pline) (vlax-ename->vla-object ray) acextendnone )) ;; delete the ray (entdel ray) (if (= 0 (rem (length ins) 2)) nil T) ;; (rem number 2) returns 1 when number is odd, 0 when even. We return T when odd, nil when even ) ;; test function: tests if a point is inside a polygon (defun c:test_picp ( / pt pline is_inside) (setq pline (car (entsel "\nSelect the closed polyline: "))) (setq pt (getpoint "\nPoint: ")) (setq is_inside (point_inside_closed_polyline pt pline)) (princ (if is_inside "\nYes, inside" "\nNo, not inside") ) (princ) ) (defun c:picp ( / ss i blk data pt pline is_inside blkname) (setq pline (car (entsel "\nSelect the closed polyline: "))) (princ "\nSelect the blocks: ") (setq ss (ssget (list (cons 0 "INSERT")))) (setq data (list)) (setq i 0) (repeat (sslength ss) (setq blk (ssname ss i)) (setq pt (cdr (assoc 10 (entget blk)))) (setq is_inside (point_inside_closed_polyline pt pline)) (if is_inside (progn (setq data (append data (list (list pt ;; insert point block (setq blkname (cdr (assoc 2 (entget blk)))) ;; block namedobjdict ;; add extra properties if wanted. Layer, rotation, ... ) ))) ) ;; ) (setq i (+ i 1)) ) (princ data) (princ) ) point_inside_closed_polyline.dwg
    1 point
×
×
  • Create New...