Leaderboard
Popular Content
Showing content with the highest reputation on 05/20/2019 in all areas
-
You might try command RTDISPLAY and set the value to 0. Hopefully it will work after that. I believe RTDISPLAY is set to 1 by default and, for whatever reason, can cause your rasters to bug out when panning or zooming. -ChriS1 point
-
Yeah when that company hired me on in 2008 I heard the site manager tell me that and that's when I realized I would kind of be on my own for drafting stuff. Also, asbuilts for military bases are even more important in many ways because the moment something breaks or goes wrong the asbuilts is the first place they look. Plus, on military bases you're commonly building around 60 year old utilities and the projects were regularly historic buildings. But I was usually able to get 90-100% accuracy on the asbuilts because for me it was a matter of pride. The base I worked on maintained a vault with permanent mylar prints and a few hundred sets were ones that I prepared personally. And it's kind of neat because I know they'll stay there. For one building they had a structure from 1940 and I went off the asbuilts to design a LEED renovation project in CAD. So I felt a kinship with that old drafter from 80 years ago. And then I wondered if my drawings would still be there in 80 years with some drafter in the future wondering who I was. -ChriS1 point
-
just by a second haha (recently had the same thing with Lee posting @ the same time) but on topic , // can be used but only (and only once) at the beginning of a network path. I use this all the time when inserting titleblocks, symbols and xrefs to avoid mapped drives.1 point
-
dunno the working of the rest of the routine but with path's in general its either / or \\ but not // as far as I know (but then I don't know everything...)1 point
-
(GetLap) never happens because (done_dialog) returns control to the (start_dialog) statement. It is similar to a goto statement in basic. (done_dialog) found HERE Example sequence (action_tile "cancel" "(done_dialog 0)");; This returns 0 to start_dialog. Anything after the (done_dialog [status]) is never evaluated (action_tile "pick" "(done_dialog 2)") ;; This returns 2 to start_dialog (setq exit_val (start_dialog)) (cond ( (= exit_val 2) (setq TmpPt (getpoint "\nSelect Point:")) ;;;do other stuff;;; ) );end_cond You control what is returned to start_dialog. If your lisp program is a river (GetLap) is an Ox Bow Lake, not accessable and cut off from the river.1 point
-
I added some code on top. A global variable keeps the number Then a string-replace function takes (setq fmt "A*=%lu6%pr3 m²") and turns the * into that number. So the number is incremented and assigned when you trigger the command a2f. The rest should still work. Do you need something extra to start numbering from something else than 1, 2, 3, ... ? (EDIT: oh yes, I changed %lu6%pr1 to %lu6%pr3, which means 3 digits right of the point/comma . Feel free to put it back to 1) (setq mynumber 0) (defun increment (str / ) (setq mynumber (+ mynumber 1)) (vl-string-subst (itoa mynumber) "*" str) ) ;;------------------------=={ Areas to Field }==------------------------;; ;; ;; ;; This program allows a user to create an MText object containing a ;; ;; Field Expression referencing the area, or sum of areas, of one or ;; ;; more selected objects. ;; ;; ;; ;; Upon issuing the command syntax 'A2F' at the AutoCAD command-line, ;; ;; the user is prompted to make a selection of objects for which to ;; ;; retrieve the area; if more than one object is selected, the ;; ;; cumulative area for all objects will be displayed by the resultant ;; ;; MText Field. ;; ;; ;; ;; Following object selection, the user is prompted to pick a point ;; ;; at which to create the MText Field. If the specified point resides ;; ;; within an AutoCAD table cell, the program will populate the table ;; ;; cell with the appropriate Field Expression. ;; ;; ;; ;; The Field will display the sum of the areas of the selected ;; ;; objects, formatted using the Field formatting code specified at ;; ;; the top of the program - this formatting code may be altered to ;; ;; suit the user's requirements. ;; ;; ;; ;;----------------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2014 - www.lee-mac.com ;; ;;----------------------------------------------------------------------;; ;; Version 1.3 - 2014-07-17 ;; ;;----------------------------------------------------------------------;; (defun c:a2f ( / *error* fmt inc ins lst sel str ) (setq fmt "A*=%lu6%pr3 m²") ;; Field Formatting (setq fmt (increment fmt)) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (if (and (setq sel (ssget '((0 . "ARC,CIRCLE,ELLIPSE,HATCH,*POLYLINE,REGION,SPLINE")))) (setq ins (getpoint "\nPick point or cell for field: ")) ) (progn (if (setq tmp (ssget "_X" (list '(0 . "ACAD_TABLE") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model") ) ) ) ) (repeat (setq idx (sslength tmp)) (setq tab (cons (vlax-ename->vla-object (ssname tmp (setq idx (1- idx)))) tab)) ) ) (if (= 1 (sslength sel)) (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " (LM:ObjectID (vlax-ename->vla-object (ssname sel 0))) ">%).Area \\f \"" fmt "\">%" ) ) (progn (repeat (setq idx (sslength sel)) (setq lst (vl-list* "%<\\AcObjProp Object(%<\\_ObjId " (LM:ObjectID (vlax-ename->vla-object (ssname sel (setq idx (1- idx))))) ">%).Area>%" " + " lst ) ) ) (setq str (strcat "%<\\AcExpr " (apply 'strcat (reverse (cdr (reverse lst)))) " \\f \"" fmt "\">%" ) ) ) ) (LM:startundo (LM:acdoc)) (if (setq tmp (LM:getcell tab (trans ins 1 0))) (apply 'vla-settext (append tmp (list str))) (vla-addmtext (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace)) (vlax-3D-point (trans ins 1 0)) 0.0 str ) ) (LM:endundo (LM:acdoc)) ) ) (princ) ) ;; ObjectID - Lee Mac ;; Returns a string containing the ObjectID of a supplied VLA-Object ;; Compatible with 32-bit & 64-bit systems (defun LM:ObjectID ( obj ) (eval (list 'defun 'LM:ObjectID '( obj ) (if (and (vl-string-search "64" (getenv "PROCESSOR_ARCHITECTURE")) (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring) ) (list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false) '(itoa (vla-get-objectid obj)) ) ) ) (LM:ObjectID obj) ) ;; Get Cell - Lee Mac ;; If the supplied point lies within a cell boundary, ;; returns a list of: (<VLA Table Object> <Row> <Col>) (defun LM:getcell ( lst pnt / dir ) (setq dir (vlax-3D-point (trans (getvar 'viewdir) 1 0)) pnt (vlax-3D-point pnt) ) (vl-some '(lambda ( tab / row col ) (if (= :vlax-true (vla-hittest tab pnt dir 'row 'col)) (list tab row col) ) ) lst ) ) ;; Start Undo - Lee Mac ;; Opens an Undo Group. (defun LM:startundo ( doc ) (LM:endundo doc) (vla-startundomark doc) ) ;; End Undo - Lee Mac ;; Closes an Undo Group. (defun LM:endundo ( doc ) (while (= 8 (logand 8 (getvar 'undoctl))) (vla-endundomark doc) ) ) ;; Active Document - Lee Mac ;; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) (vl-load-com) (princ) ;;----------------------------------------------------------------------;; ;; End of File ;; ;;----------------------------------------------------------------------;;1 point
-
Give this a try: (defun c:test ( / as el en i ss str typ ) (initget "Prefix Suffix") (setq typ (cond ((getkword "\nAdd Prefix or Suffix? [Prefix/Suffix] <Prefix>: ")) ("Prefix"))) (setq str (getstring t (strcat typ " to Add: "))) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i)))) (while (eq "ATTRIB" (cdr (assoc 0 (setq el (entget (setq en (entnext en))))))) (setq as (cdr (assoc 1 el))) (if (eq "Prefix" typ) (if (not (wcmatch as (strcat str "*"))) (entmod (subst (cons 1 (strcat str as)) (assoc 1 el) el)) ) (if (not (wcmatch as (strcat "*" str))) (entmod (subst (cons 1 (strcat as str)) (assoc 1 el) el)) ) ) ) ) ) (princ) )1 point