Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/24/2023 in all areas

  1. Hi guys, Thanks for all your reply. @Steven P's answer was pretty resolute for me. If you have BricsCAD or have the same problem with AutoCAD, I'll be sharing the Lisp Routine below: Thank you all for try to help me !! Best wishes, Rodrigo Brigido.
    1 point
  2. This is the similar line I use, I have the version at the end of it, not sure if that makes a difference? BricsCAD can be funny sometimes with VLA - commands I believe. (vla-SaveAs (vla-get-ActiveDocument (vlax-get-acad-object)) (strcat (getvar "dwgprefix") myfilename ".dwg") ac2010_dwg) (One of our clients lives in the past with ac2010, maybe I should update this one day)
    1 point
  3. A try with this which works with your example For baselines located in the east, west or north, the code must be improved... (defun find_inter (obj tmp_obj mod / vrt_pt pt lst_pt) (setq vrt_pt (vlax-variant-value (vla-IntersectWith obj tmp_obj mod))) (if (>= (vlax-safearray-get-u-bound vrt_pt 1) 0) (progn (setq pt (vlax-safearray->list vrt_pt)) (if pt (if (> (length pt) 3) (repeat (/ (length pt) 3) (setq lst_pt (cons (list (car pt) (cadr pt) (caddr pt)) lst_pt) pt (cdddr pt)) ) (setq lst_pt (cons pt lst_pt)) ) ) ) ) (if (and lst_pt (listp lst_pt)) lst_pt ) ) (defun C:3dwannab ( / ss n ent lst_pt ss_base dxf_ent pt_base ang dlt pt_tmp new_ent l_pt nw_lst) (princ "\nSelect polylines.") (setq ss (ssget '((0 . "LWPOLYLINE") (67 . 0) (8 . "TS_wall")))) (cond (ss (repeat (setq n (sslength ss)) (setq ent (ssname ss (setq n (1- n))) lst_pt (append (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget ent))) lst_pt) ) ) (princ "\nSelect the reference line.") (while (not (setq ss_base (ssget "_+.:E:S" '((0 . "LINE")))))) (setq dxf_ent (entget (ssname ss_base 0)) pt_base (list (cdr (assoc 10 dxf_ent)) (cdr (assoc 11 dxf_ent))) ang (- (rem (angle (car pt_base) (cadr pt_base)) pi) (* pi 0.5)) dlt (distance (car pt_base) (cadr pt_base)) ) (foreach pt lst_pt (setq pt_tmp (inters (car pt_base) (cadr pt_base) pt (polar pt ang dlt))) (cond ((and pt_tmp (eq (sslength (ssget "_F" (list pt pt_tmp) '((0 . "LWPOLYLINE") (67 . 0) (8 . "TS_wall")))) 1)) (repeat (setq n (sslength ss)) (entmakex (list '(0 . "LINE") '(100 . "AcDbXline") (cons 10 pt) (cons 11 pt_tmp))) (setq new_ent (entlast) ent (ssname ss (setq n (1- n))) l_pt (find_inter (vlax-ename->vla-object ent) (vlax-ename->vla-object new_ent) acExtendNone) ) (entdel new_ent) (if (eq (length l_pt) 1) (setq nw_lst (cons (car l_pt) nw_lst))) ) ) ) ) (cond (nw_lst (mapcar '(lambda (x) (entmakex (list (cons 0 "XLINE") (cons 100 "AcDbEntity") (cons 67 0) (cons 8 (getvar "CLAYER")) (cons 62 5) (cons 100 "AcDbXline") (cons 10 x) (cons 11 '(0.0 1.0 0.0)) ) ) ) nw_lst ) ) ) ) ) (prin1) )
    1 point
×
×
  • Create New...