Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Given that you indicate pre 2000 it is maybe time to upgrade. There is alternatives to Acad like Bricscad, Intellicad, Gstar to mention a few and much cheaper.
  3. Today
  4. GLAVCVS

    GNSS on AutoCAD

    Here's a simple Lisp routine for obtaining data from an integrated GNSS receiver. It works by sending a small script to PowerShell, which writes the data to a file named 'pos.txt' saved in the Documents folder. I've only tested it on a single device, but it should work on any device equipped with an integrated GNSS receiver. The data is stored in latitude/longitude format, so each user will need to transform those coordinates into the desired coordinate reference system. To stop logging the data, simply close the PowerShell window This is just a starting point for anyone who wants to adapt it to their own needs. ;************************ G L A V C V S ************************* ;************************** F E C I T *************************** ;;;THIS CODE STARTS GNSS RECEIVER AND WRITES DATA TO A FILE CALLED 'pos.txt' IN THE My Docments FOLDER (defun startGNSS (/ cmd sh dir cad ur) (setq dir (VL-REGISTRY-READ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" "Personal" ) ) (if (setq sh (vlax-create-object "WScript.Shell")) (progn (if (and (or (setq ur (getint "\nUpdate rate (milliseconds) <1000>/2000/3000/5000 : ")) (not ur)) (member ur '(nil 1000 2000 3000 5000))) (progn (setq cad (strcat "Add-Type -AssemblyName System.Device" (chr 13) (chr 10) "# 1) Conectar con AutoCAD abierto" (chr 13) (chr 10) "$outFile = \'" dir "\\pos.txt\'" (chr 13) (chr 10) "try {" (chr 13) (chr 10) " $acad = [Runtime.InteropServices.Marshal]::GetActiveObject(\'AutoCAD.Application." (itoa (atoi (getvar "ACADVER"))) "\')" (chr 13) (chr 10) "}" (chr 13) (chr 10) "catch {" (chr 13) (chr 10) " Add-Type -AssemblyName System.Windows.Forms" (chr 13) (chr 10) " [System.Windows.Forms.MessageBox]::Show(" (chr 13) (chr 10) " \'Por alguna razón no se pudo conectar con AutoCAD mediante COM.\' + [Environment]::NewLine + $_.Exception.Message," (chr 13) (chr 10) " \'GNSS-}AutoCAD: Error de conexión\'," (chr 13) (chr 10) " [System.Windows.Forms.MessageBoxButtons]::OK," (chr 13) (chr 10) " [System.Windows.Forms.MessageBoxIcon]::Error" (chr 13) (chr 10) " )" (chr 13) (chr 10) " exit" (chr 13) (chr 10) "}" (chr 13) (chr 10) "# 2) Crear y arrancar receptor de ubicación Windows/GNSS" (chr 13) (chr 10) "$w = New-Object System.Device.Location.GeoCoordinateWatcher" (chr 13) (chr 10) "$w.Start()" (chr 13) (chr 10) "# 3) Bucle continuo: comprobar estado, obtener posición y escribir en USERS5" (chr 13) (chr 10) "while ($true) {" (chr 13) (chr 10) " $doc = $acad.ActiveDocument" (chr 13) (chr 10) " $status = $w.Status" (chr 13) (chr 10) " $p = $w.Position.Location" (chr 13) (chr 10) " $time = Get-Date -Format \'dd-MM-yyyy HH:mm:ss\'" (chr 13) (chr 10) " if ($status -eq \'Disabled\') {" (chr 13) (chr 10) " $line = \'*** GNSS ERROR: GNSS disabled ***\';;;;;;\"" (chr 13) (chr 10) " }" (chr 13) (chr 10) " elseif ($status -eq \'Initializing\') {" (chr 13) (chr 10) " $line = \'*** GNSS ERROR: Searching... ***\';;;;;;\"" (chr 13) (chr 10) " }" (chr 13) (chr 10) " elseif ($status -eq \'NoData\') {" (chr 13) (chr 10) " $line = \'*** GNSS ERROR: Without data ***\';;;;;;\"" (chr 13) (chr 10) " }" (chr 13) (chr 10) " elseif ($p.IsUnknown) {" (chr 13) (chr 10) " $line = \'*** ERROR GNSS: Unknown position ***\';;;;;;\"" (chr 13) (chr 10) " }" " else {" (chr 13) (chr 10) " $line = $p.Latitude + ';' + $p.Longitude + ';' + $p.Altitude + ';' + $p.HorizontalAccuracy + ';' + $p.VerticalAccuracy" (chr 13) (chr 10) " }" (chr 13) (chr 10) " try {" (chr 13) (chr 10) " Set-Content -Path $outFile -Value $line" (chr 13) (chr 10) " }" (chr 13) (chr 10) ;;; " catch {" ;;; (chr 13) ;;; (chr 10) ;;; " Write-Host 'ERROR escribiendo...: $($_.Exception.Message)'" ;;; (chr 13) ;;; (chr 10) ;;; " }" (chr 13) (chr 10) (strcat " Start-Sleep -Milliseconds " (if ur (itoa ur) "1000")) (chr 13) (chr 10) "}" ) cmd (strcat "powershell.exe -NoProfile -ExecutionPolicy Bypass -NoExit -Command \"" cad "\"" ) ) (vlax-invoke-method sh 'Run cmd 1 :vlax-false) (grtext -1 "*** GNSS writing file \'pos.txt\' ***") ) (alert "ERROR: \nUpdate rate should be 1000, 2000, 3000 or 5000\n\nExiting...") ) (vlax-release-object sh) ) ) )
  5. pkenewell

    about grread deselect objects

    @masao_8 Before i try this code, could you please explain what is does and/or provide a sample drawing to test it on? It would save me time trying to determine what you are doing. You didn't put any comments in your code explaining it. EDIT: So I tried your code and it seems to work OK for me. It appears that it adds text for circles with the dia. and copies properties from the base circle? I kind of understand what you are going for; to be able to change option (Text height) during selection. I don't have AutoCAD 2012 or AutoCAD 2016 to test what your issue is, but I think you will have to research how express tools have changed since those versions, and if the loading is different? TIP: during your window selection, you could add the filter for CIRCLES (it's already in your "_getwindowselection" function), then you wouldn't need to pick them out while processing the selection set.
  6. masao_8

    about grread deselect objects

    @pkenewell I found an issue with the spacebar when using 'GRREAD' in CAD 2016. Like the code below, but using ARX files won't work across different versions.(CAD 2012 or 2016) ;;------------------=={ CDIA - Short English Version with TxtH }==-----------------;; (defun _redrawss (ss mode / i) (if (and ss (= (type ss) 'PICKSET) (> (sslength ss) 0)) (repeat (setq i (sslength ss)) (redraw (ssname ss (setq i (1- i))) mode) ) ) ) (defun _getwindowselection (msg p1 filter flag / gr p3 p2 p4 col winflag) (princ msg) (setq p3 nil) (while (/= 3 (car (setq gr (grread t 13 0)))) (if (= 5 (car gr)) (progn (redraw) (setq p3 (cadr gr)) (if (and p1 p3) (progn (setq p2 (list (car p3) (cadr p1) (caddr p3)) p4 (list (car p1) (cadr p3) (caddr p3)) col (if (or (eq flag "_C") (minusp (- (car p3) (car p1)))) -256 256) ) (grvecs (list col p1 p2 p1 p4 p2 p3 p3 p4)) ) ) ) ) ) (redraw) (if (and p1 p3) (progn (setq winflag (cond (flag) ((minusp (- (car p3) (car p1))) "_C") (t "_W"))) (if filter (ssget winflag p1 p3 (list filter)) (ssget winflag p1 p3)) ) nil ) ) (defun get-real-linetype (ed / lt lay layed) (setq lt (assoc 6 ed)) (if (or (null lt) (= (cdr lt) "BYLAYER")) (progn (setq lay (cdr (assoc 8 ed))) (if (setq layed (tblsearch "LAYER" lay)) (cdr (assoc 6 layed)) "CONTINUOUS") ) (cdr lt) ) ) (defun get-real-color (ed / col lay layed) (setq col (assoc 62 ed)) (if (or (null col) (= (cdr (assoc 62 ed)) 256)) (progn (setq lay (cdr (assoc 8 ed))) (if (setq layed (tblsearch "LAYER" lay)) (cdr (assoc 62 layed)) 7) ) (cdr col) ) ) (defun c:CDIA (/ old-error start-time loop_base base-ent base-ed base-ltype base-color ss express gr g1 g2 p1 pick filt i e root_path ver_name target_arx target_fas ent ed center radius loop_main pick_obj txt_h tmp _printmenu) (vl-load-com) (setq old-error *error*) (defun *error* (msg) (setvar "CMDECHO" 1) (setq *error* old-error) (princ "\n[Exit] Command ended by ESC.") (princ) ) (setvar "CMDECHO" 0) (setq txt_h 2.5) (if (not (vl-position "acetutil.arx" (arx))) (progn (if (findfile "CDIA.lsp") (setq root_path (strcat (vl-filename-directory (findfile "CDIA.lsp")) "\\")) (setq root_path (strcat (vl-filename-directory (getvar "DWGPREFIX")) "\\")) ) (if (or (null root_path) (= root_path "\\")) (setq root_path "")) (setq ver_name (strcat "R" (substr (getvar "ACADVER") 1 4))) (setq target_arx (strcat root_path "ExpressARX\\" ver_name "\\acetutil.arx")) (if (not (findfile target_arx)) (cond ((findfile (strcat root_path "ExpressARX\\R20.1\\acetutil.arx")) (setq target_arx (strcat root_path "ExpressARX\\R20.1\\acetutil.arx")) ) ((findfile (strcat root_path "ExpressARX\\R18.2\\acetutil.arx")) (setq target_arx (strcat root_path "ExpressARX\\R18.2\\acetutil.arx")) ) ) ) (setq target_fas (strcat root_path "acetutil.fas")) (if (findfile target_arx) (progn (arxload target_arx) (if (findfile target_fas) (vl-catch-all-apply 'load (list target_fas))) ) ) ) ) (setq express (and (vl-position "acetutil.arx" (arx)) (boundp 'acet-sys-shift-down) (not (null acet-sys-shift-down)))) (while t (setq start-time (getvar "DATE")) (setq loop_base t) (while loop_base (setq base-ent (entsel "\nSelect base circle (or ESC to exit)...")) (cond ((and (null base-ent) (= (getvar "ERRNO") 52)) (if (< (* 86400.0 (- (getvar "DATE") start-time)) 0.40) (progn (setvar "ERRNO" 0) (setq start-time (getvar "DATE")) ) (princ "\n[Tip] Select a circle, or press ESC to exit.") ) ) (t (setq loop_base nil)) ) ) (if (and base-ent (car base-ent)) (progn (setq base-ed (entget (car base-ent))) (if (/= (cdr (assoc 0 base-ed)) "CIRCLE") (princ "\n[Error] Object is not a circle.") (progn (setq base-ltype (get-real-linetype base-ed)) (setq base-color (get-real-color base-ed)) (setq ss (ssadd)) (setq filt (list (cons 0 "CIRCLE") (cons 6 base-ltype) (cons 62 base-color))) (defun _printmenu () (princ (strcat "\nBase -> LType: " base-ltype ", Color: " (itoa base-color) ", TxtH: " (rtos txt_h 2 2))) (princ "\n[H]:TxtH | [Space/Enter]:Done & Next Loop...") (princ "\nSelect objects: ") (princ) ) (_printmenu) (setq loop_main t) (while loop_main (setq gr (grread t 13 2) g1 (car gr) g2 (cadr gr)) (_redrawss ss 3) (cond ((= g1 5) nil) ((= g1 2) (cond ((member g2 '(13 32)) (setq loop_main nil) ) ((wcmatch (strcase (chr g2)) "H") (initget 6) (if (setq tmp (getreal (strcat "\nNew text height <" (rtos txt_h 2 2) ">: "))) (setq txt_h tmp) ) (_printmenu) ) (t nil) ) ) ((= g1 3) (if (and (setq pick_obj (nentselp g2)) (setq pick (car pick_obj)) (= (cdr (assoc 0 (entget pick))) "CIRCLE") (= (get-real-linetype (entget pick)) base-ltype) (= (get-real-color (entget pick)) base-color) ) (progn (if (and express (acet-sys-shift-down)) (if (ssmemb pick ss) (progn (ssdel pick ss) (redraw pick 4))) (if (not (ssmemb pick ss)) (ssadd pick ss)) ) ) (if (setq pick (_getwindowselection "\nSpecify Opposite Corner: " g2 nil nil)) (cond ((and express (acet-sys-shift-down)) (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (ssmemb e ss) (wcmatch (cdr (assoc 0 (entget e))) "CIRCLE")) (progn (ssdel e ss) (redraw e 4)) ) ) ) (t (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (= (cdr (assoc 0 (entget e))) "CIRCLE") (= (get-real-linetype (entget e)) base-ltype) (= (get-real-color (entget e)) base-color) (not (ssmemb e ss)) ) (ssadd e ss) ) ) ) ) ) ) (princ "\nSelect objects: ") ) ) ) (_redrawss ss 4) (if (> (sslength ss) 0) (progn (princ (strcat "\nSelected " (itoa (sslength ss)) " circles. Creating text...")) (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i)) (setq ed (entget ent)) (setq center (cdr (assoc 10 ed))) (setq radius (cdr (assoc 40 ed))) (entmake (list '(0 . "TEXT") (cons 8 (cdr (assoc 8 ed))) (cons 10 center) (cons 11 center) (cons 40 txt_h) (cons 1 (strcat "%%C" (rtos (* radius 2) 2 2))) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) ) ) (setq i (1+ i)) ) (princ "\n[OK] Finished!") ) (princ "\n[Tip] No circles selected.") ) ) ) ) ) ) (setvar "CMDECHO" 1) (setq *error* old-error) (princ) ) (princ "\nCommand CDIA loaded.") (princ)
  7. Hi, This my excle file saomle, I sent dwg file before. sample.xlsx
  8. This is what I use; I sent a support request to Bricsys, I ported it to C++ for the report since they don’t directly support Python (only BRX) from pyrx import Ap, Db, Ed, Ge #SR 223468 BRX def check_layout_status(source_db: Db.Database, dest_db: Db.Database, layout_name: str) -> bool: source_layout_dict = Db.Dictionary(source_db.layoutDictionaryId()) if not source_layout_dict.has(layout_name): print(f"Layout '{layout_name}' not found in source drawing.") return False dest_layout_dict = Db.Dictionary(dest_db.layoutDictionaryId()) if dest_layout_dict.has(layout_name): print(f"Layout '{layout_name}' already exists") return False return True def clone_layout_from_db(source_db: Db.Database, dest_db: Db.Database, layout_name: str): if not check_layout_status(source_db, dest_db, layout_name): return source_layout_dict = Db.Dictionary(source_db.layoutDictionaryId()) source_layout_id = source_layout_dict.getAt(layout_name) id_map = Db.IdMapping() id_map.setDestDb(dest_db) source_db.wblockCloneObjects( [source_layout_id], dest_db.layoutDictionaryId(), id_map, Db.DuplicateRecordCloning.kDrcIgnore, ) @Ap.Command() def doit(): layoutName = "S7" source_path = "E:\\Batch\\06457 RE Submittal.dwg" dest_db = Db.curDb() source_db = Db.Database.createFromDWG(source_path) clone_layout_from_db(source_db, dest_db, layoutName) Ap.Application.refreshMainWindow()
  9. What exactly are you trying to do? Are you using AutoCAD 2000? I only have Tilemode and CTAB in my AutoCAD 2000i at home for dealing with the Tabs. Why Diesel? You posted this in the LISP forum.
  10. You could make an AutoCAD LT code and a an AutoCAD code.
  11. Perhaps you just need to simplify it like this: (command ".-explode" obj)
  12. This is what I use or just right-click a Layout Tab.
  13. Yes, its work but I dont want to vla functions because this functions dont work acad LT. So I looking for alternative
  14. you're using AutoCAD? I recently found an issue with BricsCAD when cloning layouts auto BRX(ARX)
  15. Have you tried vla-explode?
  16. I am working on an AutoLISP routine where I need to explode a block/table object during the execution of my custom command. Currently I am using: (command "._EXPLODE" obj "") The object is exploded, and my routine usually continues, but AutoCAD also prints an “Unknown command” message after the EXPLODE operation. When I remove this EXPLODE line, the problem disappears. From what I understand, the issue may be related to using the AutoCAD EXPLODE command inside another running AutoLISP command. After the explode operation, AutoCAD may refresh or lose the expected command context, so the remaining input is interpreted incorrectly. I need to explode the object because I have to access/fill attribute-related data from the resulting entities. However, I must preserve the original block/table placement exactly: insertion point, rotation, scale, and geometry position should remain unchanged. It would also be acceptable if only the entities on a specific layer are exploded or copied out. Is there a safer/custom AutoLISP or Visual LISP way to explode a block/table object without using (command "._EXPLODE" ...)? For example, is using vla-Explode recommended in this case? If so, how can I explode or copy the block contents while preserving their transformed position, rotation, and scale exactly as they appear in the drawing? Any example function or best-practice approach would be helpful.
  17. Post the extracted data we can not help unless we have something we can touch. The correct way to approach this is to match the borehole label with its corresponding attribute data. I did this for a client and we are talking hundreds of objects like your boreholes, so have something maybe already done. The simplest way is make the tables from the data.
  18. There is more people using Bricscad these days and designing roads, surfaces drainage and sewerage is much in demand. If Admin is happy this is a link to Civil Site Design demonstration running under Bricscad. Any one who has used CIV3D or some other CIvil software may be interested. Its features are well in advance of the current inbuilt Civil features in Bricscad. https://bricsys.registration.goldcast.io/events/6416ee0a-cbec-4869-a7fa-60922b0a5905?utm_campaign=45980519-APACWebinar-NextGenCSD-26Q3-APAC&utm_source=email&utm_medium=CADapps_email&utm_content=NextGenCSD_invite
      • 1
      • Like
  19. Hi, I likewise have been using Drafix Cad since 1993 originally installed in WinXP from 2 x 3.5 floppies (Version Windows Cad 2.IE) and subsequently in win7 XP mode. Following, on upgrading to Win10 I setup a virtual machine installing XP within, plus Drafix Cad and continued to use. Being very keen to adopt your method method I set about following your procedure but alas Drafix wont install triggering the screen message "This app can't run on your PC To find a version for your PC check with the software publisher." My attempted install method was to double click on > SOFTDESK > Drafix.CAD Have you any suggestions to help me sort this out? Much Appreciated pgcpty
  20. Yesterday
  21. Just using the "-LAYOUT" command worked great in my case. I was using the vla-CopyObjects method to pull other properties from a template file and didn't know Layouts weren't supported. Thanks for the help everyone.
  22. 'Showtabs" does not exist in my AutoCAD 2027. Are these the variables you're after? FILETAB: Type this into the command line to instantly display the file tabs. FILETABCLOSE: Type this into the command line to hide the file tabs. FILETABSTATE: The system variable used to check or set their status (1 for on, 0 for off)
  23. pkenewell

    about grread deselect objects

    @masao_8 The Express tools must be installed with AutoCAD. If you mean just loading it, it's in my code above: (if acet-load-expresstools (acet-load-expresstools)) To make a grread loop work exactly like ssget. it's a huge ask. There is a ton of options to emulate. Could you explain EXACTLY what you want the function to do? What you're asking for has seemed to shift, or you weren't explaining it well enough. Below is an update to my code to add just the auto window and crossing selection: ;; Function to do a simple Select/Deselect using grread. ;; By PJK - 6/16/2026 ;; Updated 6/29/2026 to add window selection emulation (defun pjk-grread-Select (/ done en grl grc grv ss ss->elst sx wp1 wp2) (defun ss->elst (ss / i r) (if ss (repeat (setq i (sslength ss))(setq r (cons (ssname ss (setq i (1- i))) r))) ) ) (if acet-load-expresstools (acet-load-expresstools)) (setq ss (ssadd)) (princ "\nSelect to add objects or SHIFT+Select to remove from selection set: ") (while (not done) (setq grl (grread T 15 (if wp1 0 2)) grc (car grl) grv (cadr grl) ) (cond ((= grc 5) (redraw) (if wp1 (progn (grdraw wp1 (list (car grv) (cadr wp1) (caddr wp1)) -1 (if (< (car grv) (car wp1)) 1 0)) (grdraw wp1 (list (car wp1) (cadr grv) (caddr wp1)) -1 (if (< (car grv) (car wp1)) 1 0)) ) ) ) ((= grc 3) (if (acet-sys-shift-down) (if (setq en (car (nentselp grv))) (progn (if (ssmemb en ss)(ssdel en ss)) (redraw en 4) ) (if (not wp1) (progn (setq wp1 grv) (princ "\rSelect opp corner: ") ) (progn (redraw) (setq wp2 grv) (if (< (car wp2) (car wp1)) (mapcar '(lambda (a)(ssdel a ss)(redraw a 4)) (setq sx (ss->elst (ssget "C" wp1 wp2))) ) (mapcar '(lambda (a)(ssdel a ss)(redraw a 4)) (setq sx (ss->elst (ssget "W" wp1 wp2))) ) ) (princ (strcat "\n(" (itoa (length sx) ) ") Objects found and Removed from selection. " ) ) (setq wp1 nil wp2 nil) ) ) ) (if (setq en (car (nentselp grv))) (progn (ssadd en ss) (redraw en 3) ) (if (not wp1) (progn (setq wp1 grv) (princ "\rSelect opp corner: ") ) (progn (redraw) (setq wp2 grv) (if (< (car wp2) (car wp1)) (mapcar '(lambda (a)(ssadd a ss)(redraw a 3)) (setq sx (ss->elst (ssget "C" wp1 wp2))) ) (mapcar '(lambda (a)(ssadd a ss)(redraw a 3)) (setq sx (ss->elst (ssget "W" wp1 wp2))) ) ) (princ (strcat "\n(" (itoa (length sx)) ") Objects found and added to selection. " ) ) (setq wp1 nil wp2 nil) ) ) ) ) ) ((= grc 2) (setq done (if (vl-position kcode '(13 32)) T nil)) ) ((= grc 25)(setq done T)) ) ) (if (> (sslength ss) 0) (progn (foreach i (mapcar 'cadr (ssnamex ss))(redraw i 4)) ss ) nil ) )
  24. masao_8

    about grread deselect objects

    If Express Tools isn't installed in AutoCAD, how can I load it while this code is running? I want to achieve a functionality similar to "ssget", but with shortcut key support. @Tsuky thanks you so much.
  25. Hi, I extracted the results from PDF files, and it’s very tedious and time-consuming work. I have several lines in my cells, and each line should be a different color. Have you written a program for this before?
  26. I Have Autocad Lt, and office soft wares as well
  27. Greetings y'all. I've created a block that has a Linear Parameter in it so I can easily adjust the length. I've also put a Dimension into the block then turned off all the arrows/extension lines/etc. That way I have a quick visual check showing ho long the block is. I've also made plan/elev/end views that show up with Viz States. All good. My one problem is that when I pick the end view, the two dots that show where the Dimension attaches at are visible, and I've accidentally selected and deleted blocks when I drag a window that includes these dots. In the file attached, the 26'-6" text is from the Dimension and the 20' is from the Field/MText. I have some ideas of what I want I'm not sure how to make them work: 1) Turn these dots off. I don't think this is possible. 2) Insert a Field in an MText that is set to show the Measurement of the Dimension. I thought this would work but it doesn't update when I stretch the block out. 3) Some other idea anyone may have? 4) Give up and turn off the dimension in the end view. I'd prefer to keep it if possible, but it's only an issue in the end view b/c the dimension is as long as the visible portions in plan/side views so the dots aren't 'outside' of the block. Thanks y'all! Drawing2.dwg
  28. Tsuky

    about grread deselect objects

    I don't know if I understood exactly what the need was, but here is my proposal. Moving the cursor over entities adds to the selection if the mode is active (left-click) and pressing + or - toggles to add or remove. (defun C:AutoSel ( / oldpcka key_mod ss tmp key_sel e_sel) (setq oldpcka (getvar "PICKADD") key_mod 'ssadd) (setvar "PICKADD" 2) (or (setq ss (ssget "_I")) (setq ss (ssget "_P")) ) (if ss (sssetfirst nil ss) (setq ss (ssadd))) (princ "\n[+/-]: AutoSelect ADD/REMOVE [Left-Click]: AutoSelect ON/OFF [Right-Click]: Quit AutoSelect ") (princ "\nAutoSelect <<OFF>>") (while (or (= 5 (car (setq tmp (grread t 5 2)))) (= 3 (car tmp)) (member tmp '((2 43) (2 45)))) (cond ((= 2 (car tmp)) (cond ((eq (cadr tmp) 43) (setq key_mod 'ssadd) (princ "\nMode add select") ) ((eq (cadr tmp) 45) (setq key_mod 'ssdel) (princ "\nMode remove select") ) ) ) ((= 3 (car tmp)) (if (null key_sel) (progn (setq key_sel T) (princ "\nAutoSelect <<ON>>") ) (progn (setq key_sel nil) (princ "\nAutoSelect <<OFF>>") ) ) ) ((= 5 (car tmp)) (cond ((and key_sel (setq e_sel (nentselp (cadr tmp)))) (cond ((eq 'ENAME (type (car (last e_sel)))) ((eval key_mod) (car (last e_sel)) ss) ) ((eq "VERTEX" (cdr (assoc 0 (entget (car e_sel))))) ((eval key_mod) (cdr (assoc 330 (entget (car e_sel)))) ss) ) (T ((eval key_mod) (car e_sel) ss)) ) (sssetfirst nil ss) ) (T nil) ) ) (T (princ "\nAbnormal command shutdown ")) ) ) (setvar "PICKADD" oldpcka) (princ "\nEnd of command. ") (prin1) )
  1. Load more activity
×
×
  • Create New...