Leaderboard
Popular Content
Showing content with the highest reputation on 05/11/2020 in all areas
-
Dlanorh seemed to fix (command "pedit" (ssname ss 0) "_y" "_J" ss "" "") missing convert to pline yes2 points
-
You can just do it with a Visibility state. Make one for OPEN and one for CLOSED. There are some really great tutorials out there on how to use Visibility States... here's just one of them.1 point
-
Is there any chance that some of the ancient user display personal preferences can be restored? I work on a 43" monitor, and I really dislike having to scroll all the way to the bottom to access the latest post on a thread. Back in the day when I was on all day everyday, there was a personalized display sort setting, and lots of others. My favorite was to have NEWEST at the top. Likewise when opening a multi page thread, I personally prefer being directed to the NEWEST post, rather than the original post. I understand that are very personal preferences, which I miss being able to define in User Profile Preferences.1 point
-
Apologies. This is a system variable problem (peditaccept). I have altered the code in my original post to account for this, or you can go with @BIGAL approach and replace the command call in my code with his.1 point
-
If the dwg has a filename.dwl its open by someone else, but a warning if a dwg crashes the dwl can be left behind. So maybe a double check dwl and file att read only. Part of my file clean-ups was to delete dwl's can not delete one open.1 point
-
You should have asked for help where you found the code posted by CafeJr, I'm not sure the my_plot portion of the code was written by Lee Mac. https://www.cadtutor.net/forum/topic/63153-batch-print-to-pdf/?do=findComment&comment=5210591 point
-
You can check if a dwg has the attribute set to read only so can do the open with an extra yes. Just goggle check file attribute.1 point
-
1 point
-
Something like this what you're after? Or am I still missing something? (defun c:survey ( / *error* acadobj activeundo adoc dets esclays i instpt lay1 lay2 layers msp pointheight rtn ss tolerance totable txthgt vtab) (defun *error* ( msg ) (vla-EndUndoMark adoc) (if (not (wcmatch (strcase msg T) "*break*,*cancel*,*exit*")) (princ (strcat "Error: " msg)) ) ) (setq acadobj (vlax-get-acad-object) adoc (vla-get-ActiveDocument acadobj) msp (vla-get-ModelSpace adoc) activeundo nil) (if (= 0 (logand 8 (getvar "UNDOCTL"))) (vla-StartUndoMark adoc) (setq activeundo T)) (setq ;; ------------------------------------------ SETUPS ------------------------------------------ ;; layers '("IFC" "As-Built") ; <--- a list of two strings (texts) representing the layer of the texts ; ^^^ the first layer will be compared to the second. pointheight 400 ; <--- the text height for the labels on the drawing tolerance 200 ; <--- the tolerance (how far apart should the points be to still be considered equal) ;; Table generated will only look based on screen size, so irrespective of zoom ;; ------------------------------------------ SETUPS ------------------------------------------ ;; esclays (mapcar '(lambda (x) (cons 8 (LM:escapewildcards x))) layers) ) (if (and (setq ss (ssget (append '((0 . "LINE") (-4 . "<OR")) esclays '((-4 . "OR>"))))) (foreach x (JH:selset-to-list ss) (if (eq (strcase (cdr (assoc 8 (entget x)))) (strcase (car layers))) (setq lay1 (cons (list (vlax-curve-getStartPoint x) (vlax-curve-getEndPoint x)) lay1)) (setq lay2 (cons (list (vlax-curve-getStartPoint x) (vlax-curve-getEndPoint x)) lay2)) ) ) (setq lay1 (LM:UniqueFuzz (apply 'append lay1) tolerance) lay2 (LM:UniqueFuzz (apply 'append lay2) tolerance)) (progn (foreach x lay1 (vl-some '(lambda (y) (if (equal y x tolerance) (setq rtn (cons (list x y) rtn))) ) lay2 ) ) rtn ) (setq instpt (getpoint "\nSpecify insertion point for table: ")) ) (progn (setq i 0 txthgt (* 0.011 (getvar 'viewsize)) dets (mapcar '(lambda (x / vt) (vla-put-Alignment (setq vt (vla-AddText msp (itoa (setq i (1+ i))) (vlax-3d-point 0 0 0) pointheight)) acAlignmentTopLeft ) (vla-put-TextAlignmentPoint vt (vlax-3d-point (car x))) (list (itoa i) (rtos (cadar x) 2 3) (rtos (caar x) 2 3) (rtos (cadr (last x)) 2 3) (rtos (car (last x)) 2 3) (rtos (apply '- (mapcar 'cadr x)) 2 0) (rtos (apply '- (mapcar 'car x)) 2 0) (rtos (apply 'distance x) 2 0) "OUT" ) ) rtn ) totable (cons '("" "DESIGN" "" "AS-BUILT" "" "DIFFERENCE" "" "" "DISCR") (cons '("S No." "NORTHING" "EASTING" "NORTHING" "EASTING" "DIF N" "DIF E" "DIF DIST" "") dets) ) vtab (vla-AddTable msp (vlax-3d-point instpt) (+ 2 (length dets)) 9 (* 2 txthgt) (* 15 txthgt)) ) (vla-put-RegenerateTableSuppressed vtab :vlax-true) (vla-UnmergeCells vtab 0 (1+ (length dets)) 0 8) (foreach x '( (0 0 1 2) (0 0 3 4) (0 0 5 7) (0 1 8 8) ) (apply 'vla-MergeCells (append (list vtab) x)) ) (vla-put-RegenerateTableSuppressed (JH:put-list-to-table vtab totable 0 0 txthgt) :vlax-false) ) ) (if activeundo nil (vla-EndUndoMark adoc)) (princ) ) ;; JH:selset-to-list --> Jonathan Handojo ;; Returns a list of entities from a selection set ;; ss - selection set (defun JH:selset-to-list (selset / lst iter) (if selset (repeat (setq iter (sslength selset)) (setq lst (cons (ssname selset (setq iter (1- iter))) lst)) ) ) ) ;; JH:put-list-to-table --> Jonathan Handojo ;; Attempts to put a list of texts into a table. ;; vtab - table VLA object ;; lst - a list where each item is another list of strings to be put into the table ;; row - the first (upper) row where the list will be inserted (zero-based index) ;; col - the first (left) column where the list will be inserted (zero-based index) ;; hgt - text height on table (nil to ignore) (defun JH:put-list-to-table (vtab lst row col hgt / activesuppressed i j) (if (eq (vla-get-RegenerateTableSuppressed vtab) :vlax-true) (setq activesuppressed T) (vla-put-RegenerateTableSuppressed vtab :vlax-true) ) (setq i 0) (foreach x lst (setq j -1) (foreach y x (vl-catch-all-apply 'vla-SetText (list vtab (+ row i) (+ col (setq j (1+ j))) y)) (if hgt (vl-catch-all-apply 'vla-SetCellTextHeight (list vtab (+ row i) (+ row j) hgt)) ) ) (setq i (1+ i)) ) (if (null activesuppressed) (vla-put-RegenerateTableSuppressed vtab :vlax-false)) vtab ) ;;; -------------------------------- ONLINE REFERENCES -------------------------------- ;;; ;; Escape Wildcards - Lee Mac ;; Escapes wildcard special characters in a supplied string (defun LM:escapewildcards ( str ) (vl-list->string (apply 'append (mapcar '(lambda ( c ) (if (member c '(35 64 46 42 63 126 91 93 45 44)) (list 96 c) (list c) ) ) (vl-string->list str) ) ) ) ) ;; Unique with Fuzz - Lee Mac ;; Returns a list with all elements considered duplicate to ;; a given tolerance removed. (defun LM:UniqueFuzz ( l f / x r ) (while l (setq x (car l) l (vl-remove-if (function (lambda ( y ) (equal x y f))) (cdr l)) r (cons x r) ) ) (reverse r) ) Some credits go to Lee Mac for his subfunctions.1 point
-
Definitely possible. Give me some time, I'll have a solution ready for you (or maybe someone will jump in to help as well)1 point
-
1 point
-
For one reason or another I'm unable to see any points or texts, but I'm assuming you want to find the discrepancies of each of the points between the as-builts and for-construnction drawings whose points are a maximum of 0.5m (maybe max of 1) apart from one another yea? Again, how do you calculate the DIF DIST? is that just the distance apart between the two points? And what about the last column? Nice building there!1 point
-
Since you sound desperate for help, I'll be happy to lend a hand. Over here (at least for me), I post things here for free without any copyrights (except my subfunctions) Post a sample dwg so I can visualise better If I'm understanding right, you have a bunch of points in your dwg on two different layers (same number of points for both layers), and you want to extract those points and export to the image shown above? How is the DIF DIST determined?1 point