Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/26/2021 in all areas

  1. You might look at Lee's point manager too.
    1 point
  2. needs (vl-load-com) (defun c:TESTADDT (/ ptSet tPt ptLst outLst) (vl-load-com) (if (setq ptSet (ssget "_X" '((0 . "INSERT"))))
    1 point
  3. I can understand your frustration. After 30 years, I am intimately familiar with the inadequacy of AutoCAD. Right now, for instance, I'm dealing with a plotter driver that crashes AutoCAD about half the time. I would suggest that first you learn everything you can about the user interface. There are shortcuts and customizations that will make your work easier. I can open the Properties window by selecting an object, right clicking, and picking Properties from the pop-up menu. The advice here from 2008 is still good, as far as I know. If you still have trouble, tell us as much as you can about your installation and what you've done so far to solve the issue. And welcome to the forum.
    1 point
  4. TRY (defun c:TESTADDT(/ ptSet tPt ptLst outLst) (if (setq ptSet(ssget "_X" '((0 . "INSERT")))) (progn (setvar "cmdecho" 0) (setq I 0) ; Order of POINT (while (< I (sslength ptSet) ) (setq BLK (cdr (assoc 2 (entget (setq Txt_BLK(ssname ptSet I )))))) (setq BLK_INSERTIONPOINT (vlax-get (vlax-ename->vla-object Txt_BLK) 'INSERTIONPOINT)) (setq def (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) BLK)) (setq ptLst(vl-sort (mapcar '(lambda(x)(list(distance (cAr x) BLK_INSERTIONPOINT) (cadr x))) (mapcar '(lambda(x)(list (cdr(assoc 10 x)) (cdr(assoc -1 x)))) (mapcar 'entget(vl-remove-if 'listp (mapcar 'cadr(ssnamex (ssget "X" '((0 . "TEXT") (8 . "2") )))))))) '(lambda(a b)(<(car a)(car b))))) (setq outLst(CAR(cdr (cAr ptLst)))) (setq Text (cdr (assoc 1 (entget outLst)))) (setq Txt_INSERTIONPOINT (vlax-get (vlax-ename->vla-object outLst) 'INSERTIONPOINT)) (setq Txt_Lay (vlax-get (vlax-ename->vla-object outLst) 'layer)) (setq Txt_Height (vlax-get (vlax-ename->vla-object outLst) 'height)) ( IF (= BLK "Circle_1") (PROGN (vlax-for obj def (if (wcmatch (vla-get-objectname obj) "AcDbAttribute*") (if (wcmatch (setq tagstr (vla-get-tagstring obj)) "TAG_3") (setq pipenamelist0 (LIST tagstr obj)) ) ) ) ( IF (= pipenamelist0 NIL) (PROGN (setq daddattribut (vla-addattribute def Txt_Height acattributemodelockposition "New Attribute" ;;TAG_3 ;;(vlax-3D-point 0 (- (* 1.5 Txt_Height))) (vlax-3D-point (mapcar (function (lambda (a b) (- a b))) Txt_INSERTIONPOINT BLK_INSERTIONPOINT )) "TAG_3" Text )) (vla-put-ScaleFactor daddattribut (vlax-get-property (vlax-ename->vla-object outLst) 'ScaleFactor)) (command "_.attsync" "_N" BLK) ) (PROGN (vla-put-TextString (CAR(CDR pipenamelist0)) (vla-get-TextString (vlax-ename->vla-object outLst))) (vla-put-ScaleFactor (CAR(CDR pipenamelist0)) (vlax-get-property (vlax-ename->vla-object outLst) 'ScaleFactor)) (command "_.attsync" "_N" BLK) ) ) ) ) ( IF (= BLK "Square_1") (PROGN (vlax-for obj def (if (wcmatch (vla-get-objectname obj) "AcDbAttribute*") (if (wcmatch (setq tagstr (vla-get-tagstring obj)) "TAG_7") (setq pipenamelist (LIST tagstr obj)) ) ) ) ( IF (/= pipenamelist NIL) (PROGN (vla-put-TextString (CAR(CDR pipenamelist)) (vla-get-TextString (vlax-ename->vla-object outLst))) (vla-put-ScaleFactor (CAR(CDR pipenamelist)) (vlax-get-property (vlax-ename->vla-object outLst) 'ScaleFactor)) (command "_.attsync" "_N" BLK) ) (PROGN (setq daddattribut (vla-addattribute def Txt_Height acattributemodelockposition "New Attribute" ;;TAG_3 ;;(vlax-3D-point 0 (- (* 1.5 Txt_Height))) (vlax-3D-point (mapcar (function (lambda (a b) (- a b))) Txt_INSERTIONPOINT BLK_INSERTIONPOINT )) "TAG_7" Text )) (vla-put-ScaleFactor daddattribut (vlax-get-property (vlax-ename->vla-object outLst) 'ScaleFactor)) (command "_.attsync" "_N" BLK) ) ) ) ) (SETQ I (+ 1 I)) ) ); end progn ); end if (setvar "cmdecho" 1) ); end of c:npts
    1 point
  5. One quick trick is to set one viewport how you want, then "matchprop" command to quickly set those same layer properties and viewport scale to other viewports as you see fit. But I see what you are looking to do and that may not be enough. There may be a LISP routine that could do this with a couple clicks but i'm not 100% sure. -ChriS
    1 point
  6. This is kind of interesting. It's a free web based program that allows you to trace over a photo and turn it into a rough 3D object which you can then export and take into Blender to sculpt and refine. Here's the site: https://monstermash.zone/ And here's a tutorial:
    1 point
  7. Since you're reacting specifically to the use of the CLOSE/QUIT commands, you might instead consider the use of a vlr-dwg-reactor with a callback function triggered on the :vlr-beginClose event or a vlr-docmanager-reactor with a callback function triggered on the :vlr-documentToBeDestroyed event.
    1 point
  8. Very simple method: (defun selectinside ( ent acc / i j l ) (setq i (/ (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)) acc) j (- i) ) (repeat (fix acc) (setq l (cons (trans (vlax-curve-getpointatdist ent (setq j (+ j i))) 0 1) l)) ) (ssget "_WP" l) ) Test function: (defun c:test ( / e ) (if (and (setq e (car (entsel))) (member (cdr (assoc 0 (entget e))) '("CIRCLE" "ELLIPSE" "SPLINE" "LWPOLYLINE" "POLYLINE")) ) (sssetfirst nil (selectinside e 100)) ) (princ) ) (vl-load-com) (princ) Otherwise, use my Entity to Point List function to approximate the object by a point list.
    1 point
×
×
  • Create New...