Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/31/2021 in all areas

  1. ObjectDBX allows you to open a DWG for read/write and optionally make changes to the DWG file, but you are limited in what actions you can take. The DWG is simply opened in memory and not in the AutoCAD graphical editor, and because so, certain actions are forbidden, such as asking the user to make a selection (since that is impossible). But if you wanted to draw a line from 5,5 to 8,3 - this could be done. Obviously, because the DWG is not being opened in the editor, making changes to multiple drawings is lightning fast. LeeMac has some good examples of this here: http://www.lee-mac.com/odbxbase.html
    2 points
  2. You can use the ActiveX taborder property to sort the layouts by the order in which they appear in the drawing, e.g.: ( (lambda ( / dwg dwp idx lst ) (setq dwp (getvar 'dwgprefix) dwg (getvar 'dwgname) ) (vlax-for lyt (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (strcase (vla-get-name lyt) t) "*plan*") (setq lst (cons (vla-get-name lyt) lst) idx (cons (vla-get-taborder lyt) idx) ) ) ) (foreach n (vl-sort-i idx '<) (setq lyt (nth n lst)) (write-line (strcat "[DWF6Sheet:" dwg "-" lyt "]" "\nDWG=" dwp dwg ".dwg" "\nLayout=" lyt "\nSetup=" "\nOriginalSheetPath=" dwp dwg ".dwg" "\nHas Plot Port=0" "\nHas3DDWF=0" ) file ) ) ) )
    1 point
  3. Problem one: (defun C:VV1 (/ cmd osm olderr ss PT index DS N13 N14) (setq cmd (getvar "CMDECHO") osm (getvar "OSMODE") olderr *error* *error* myerror ) (princ "Please select dimension object!") (setq ss (ssget '((0 . "DIMENSION")))) (setvar "CMDECHO" 0) (setq PT (getpoint "\nPoint to trim or extend:") PT (trans PT 1 0) ) (command "UCS" "_W") (repeat (setq index (sslength ss)) (setq DS (entget (ssname ss (setq index (1- index))))) (cond ((equal (cdr (assoc 50 DS)) 0.0 0.001) (setq N13 (cons 13 (list (car (cdr (assoc 13 DS))) (cadr PT) (caddr (cdr (assoc 13 DS))))) DS (subst N13 (assoc 13 DS) DS) N14 (cons 14 (list (car (cdr (assoc 14 DS))) (cadr PT) (caddr (cdr (assoc 14 DS))))) DS (subst N14 (assoc 14 DS) DS) ) (entmod DS) ) ((equal (cdr (assoc 50 DS)) (/ pi 2) 0.001) (setq N13 (cons 13 (list (car PT) (cadr (cdr (assoc 13 DS))) (caddr (cdr (assoc 13 DS))))) DS (subst N13 (assoc 13 DS) DS) N14 (cons 14 (list (car PT) (cadr (cdr (assoc 14 DS))) (caddr (cdr (assoc 14 DS))))) DS (subst N14 (assoc 14 DS) DS) ) (entmod DS) ) ) ) (command "UCS" "_P") (setvar "CMDECHO" cmd) (setvar "OSMODE" osm) (setq *error* olderr) (princ) ) Problem two: ;;; select horizontal and vertical dimension (setq ss (ssget (list (cons 0 "DIMENSION") (cons -4 "<OR") (cons 50 0.0) (cons 50 (/ pi 2)) (cons -4 "OR>") ) ) ) (repeat (setq index (sslength ss)) (if (not (equal (last (entget (ssname ss (setq index (1- index))))) '(100 . "AcDbRotatedDimension"))) (ssdel (ssname ss index) ss) ) )
    1 point
  4. Try this has a homework attached google text readable hint lee-mac. ; simple text at mid of rectang alanh AUG 2021 (defun c:wow ( / rec co-ord p1 p2 p3 and d1 d2) (setq oldang (getvar 'aunits)) (setvar 'aunits 3) (while (setq rec (entsel "\npick rectang Enter to exit")) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car rec))))) (setq p1 (nth 0 co-ord) p2 (nth 1 co-ord) p3 (nth 2 co-ord) ) (setq d1 (distance p1 p2) d2 (distance p2 p3) ) (setq mp (mapcar '* (mapcar '+ p1 p3) '(0.5 0.5))) (if (> d1 d2) (setq ang (angle p1 p2)) (setq ang (angle p2 p3)) ) (command "text" mp 2.5 ang "abc") ) (setvar 'aunits (oldang)) (princ) )
    1 point
  5. I have corrected my post above, I realised that before it also selected aligned dimensions that resulted in a 0° angle. Now it selects rotated dimensions with a rotation angle of 0° or 90°, because horizontal and vertical dimensions are special types of rotated dimensions.
    0 points
×
×
  • Create New...