Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/03/2023 in all areas

  1. As @mhupp points out, using (vla-AddDimArc) and (vla-AddDimAligned) will be faster. Here is the code (I should have done it before) Dim_PolyArc.lsp
    2 points
  2. And this: (setq ss (ssget "_X" '((0 . "LINE") (6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS"))))
    1 point
  3. (setq s (ssget '((0 . "LINE") (-4 . "<NOT") (6 . "DASHED,CENTER,CONTINUOUS") (-4 . "NOT>"))))
    1 point
  4. Check these system variables: PICKFIRST should be 1 DBLCLKEDIT should be on noun/verb selection should be on Check your UI behavior, default double-click should be, well, whatever you were doing, instead of TEXTEDIT. If that doesn't help, please provide more information. Welcome to the forum!
    1 point
  5. Elektrik, this VLA approach should set you in the right direction. No error trapping. (defun C:LAYER-TEST ( / doc lay suf sel lyr col ) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq lay (vla-get-layers doc)) (setq suf "_1") (if (ssget) (progn (vlax-for x (setq sel (vla-get-activeselectionset doc)) (cond ((not (tblsearch "Layer" (setq lyr (strcat (vla-get-layer x) suf)))) (vla-put-color (vla-add lay lyr) (setq col (vla-get-color (vla-item lay (vla-get-layer x)))) ) (vla-put-layer x lyr) ) ( t (if (not (= (vla-get-color (vla-item lay lyr)) col)) (progn (vla-put-color (vla-item lay lyr) col) (vla-put-layer x lyr) ) ) ) ) ) (vla-delete sel) ) ) (princ) ) (princ)
    1 point
  6. Not sure were I found this. Group-UnGroup 1.01.lsp
    1 point
  7. @Engineer_Yasser updated your code to work with polylines longer then one segment. Then I noticed depending on the zoom some dims might not be created. particularity the 7.40 and 14.52 . updating to visual lisp and not using command fixes this issue and should make it run faster. (defun c:test (/ sel myent bulg i p1 p2 mid a r c) (vl-load-com) (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (setq mspace (vla-get-ModelSpace doc)) ;forgot this line (if (setq sel (ssget '((-4 . "<AND") (0 . "*POLYLINE") (-4 . "<>") (42 . 0.0) (-4 . "AND>")))) (foreach MyEnt (vl-remove-if 'listp (mapcar 'cadr (ssnamex sel))) (setq bulg (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 42)) (entget MyEnt)))) (if (/= (cdr (assoc 70 (entget MyEnt))) 1) (vl-remove (last bulg) bulg) ) (setq i 0) (foreach seg bulg (if (and (/= seg 0.0) (setq p1 (vlax-Curve-GetPointAtParam MyEnt i) mid (vlax-Curve-GetPointAtParam MyEnt (+ i 0.5)) p2 (vlax-Curve-GetPointAtParam MyEnt (+ i 1)) ) ) (progn ;pulled from here http://www.lee-mac.com/bulgeconversion.html#bulgearc (setq a (* 2 (atan seg)) r (/ (distance p1 p2) 2 (sin a)) c (polar p1 (+ (- (/ pi 2) a) (angle p1 p2)) r) ) (vla-AddDimArc mspace (vlax-3d-point c) (vlax-3d-point p1) (vlax-3d-point p2) (vlax-3d-point mid)) ;(Command "_.DIMARC" MyEnt "_non" mid "_non" mid) ) ) (setq i (1+ i)) ) ) ) (vla-EndUndoMark doc) ;and this line (princ) )
    1 point
  8. Quickly written, but should do the job - (defun c:test ( / d ) (vlax-for b (vla-get-blocks (setq d (vla-get-activedocument (vlax-get-acad-object)))) (if (= :vlax-false (vla-get-isxref b) (vla-get-islayout b)) (vlax-for o b (if (and (= "AcDbCircle" (vla-get-objectname o)) (equal 0.0 (vla-get-radius o) 1e-8) (vlax-write-enabled-p o)) (vla-put-radius o 1.0) ) ) ) ) (vla-regen d acallviewports) (princ) ) (vl-load-com) (princ)
    1 point
×
×
  • Create New...