Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/15/2021 in all areas

  1. You're welcome To account for cases in which the target layer differs from the source linetype, consider the following: (defun c:fixlay ( / doc itm lay lst lyr ) (setq lst '( ;; Source Linetype Target Layer ("DASHED" "HIDDEN" ) ("CENTER" "CENTER" ) ("PHANTOM" "PHANTOM") ) ) (setq doc (vla-get-activedocument (vlax-get-acad-object)) lyr (vla-get-layers doc) ) (vlax-for blk (vla-get-blocks doc) (if (= :vlax-false (vla-get-isxref blk)) (vlax-for obj blk (if (and (setq itm (cadr (assoc (strcase (vla-get-linetype obj)) lst))) (vlax-write-enabled-p obj) (or (member itm lay) (and (vla-add lyr itm) (setq lay (cons itm lay)) ) ) ) (progn (vla-put-linetype obj "bylayer") (vla-put-linetypescale obj 0.2) (vla-put-layer obj itm) ) ) ) ) ) (princ) ) (vl-load-com) (princ)
    2 points
  2. Yes AutoCAD's Raster tools are not bad at all. There will never, in our life times, be a one click raster-2-vector. I just don't see it.
    1 point
  3. AutoCAD's version is the only one I've tried and it works well enough if you can find the right fonts for the conversion. This site is helpful for identifying fonts from clipped images of text: https://www.fontsquirrel.com/matcherator?token=ohd8q2l7ylb75dti The Text Styles that are difficult are fit text or text with a defined width other than 1.
    1 point
  4. Try this ; pick attribute paste text to cell in table ; By AlanH with help from lee-mac and Grrr ; July 2021 (Defun LM:Hittest ( Pt Lst ) ; Lee Mac (If (And (Vl-consp Pt) (Vl-every 'Numberp Pt)) (Vl-some (Function (Lambda ( O / R C ) (If (Eq :Vlax-true (Vla-hittest O (Vlax-3d-point (Trans Pt 1 0)) (Vlax-3d-point (Trans (Getvar 'Viewdir) 1 0)) 'R 'C)) (List O R C) ) ) ) Lst ); Vl-some ); If ); Defun Hittest (Defun Getacadtableobjects ( / Ss I L ); Grrr1337 (If (Setq Ss (Ssget "X" (List '(0 . "Acad_table") (If (= 1 (Getvar 'Cvport)) (Cons 410 (Getvar 'Ctab)) '(410 . "Model"))))) (Repeat (Setq I (Sslength Ss)) (Setq L (Cons (Vlax-ename->vla-object (Ssname Ss (Setq I (1- I)))) L)) ) ); If ); Defun Getacadtableobjects (defun putatt2cell (txt pt / tables rows cols) (setq Tables (Getacadtableobjects)) (setq ans (LM:Hittest Pt Tables)) (setq objtable (nth 0 ans) rows (nth 1 ans) cols (nth 2 ans)) (vla-settext Objtable rows cols txt) (princ) ) ; **************************** (defun c:att2cell ( / att cpt str) (while (setq att (nentsel "\nPick attribute Enter to exit : ")) (setq cpt (getpoint "\nPick cell in table ")) ;(setq str (cdr (assoc 1 (entget (car att))))) (setq id (itoa (vla-get-objectid (vlax-ename->vla-object (car att))))) (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " id ">%).TextString>%")) (putatt2cell str cpt) ) (princ) )
    1 point
  5. If you don't want to use "vl-cmdf" try the following. (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex gru))) (entdel ent) ) or (repeat (setq i (sslength gru)) (entdel (ssname ss (setq i (1- i)))) )
    1 point
  6. (defun c:dOff ( / *error* of undo doc ss ) (vl-load-com) (defun *error* ( msg ) (and undo (vla-EndUndomark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (if (and (setq gru (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) (setq of (getdist "\nSpecify Offset Distance: "))) (progn (setq undo (not (vla-StartUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object) ) ) ) ) ) (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc)) (mapcar '(lambda ( elem ) (vl-catch-all-apply 'vla-offset (list obj elem)) ) (list of (- of)) ) ) (vla-delete ss) (vl-cmdf "_ERASE" gru "") (setq undo (vla-EndUndoMark doc)) ) ) (princ) ) I set the ssget with the variable gru: (setq gru (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) The gru selection is deleted: (vl-cmdf "_ERASE" gru "") Aesthetically it's a variation that might make purists cringe and I don't blame them, not least because I try to avoid the command and vl-cmdf function, but it's the one that's much quicker to write.
    1 point
×
×
  • Create New...