Leaderboard
Popular Content
Showing content with the highest reputation since 10/15/2026 in Posts
-
So in keeping with posting some of my LISPs, I used this just the other day, and just was reminded with the recent resurrection of the Fillet 0 issue thread where the OP was doing 40,000, not sure what LISP they used. Per the latest resurrection, setting FILLETPOLYARC setting may or may not help depending on what you are trying to fillet. The few times I have seen Fillet 0 fail with the P option was when the fillet radii completed something like a half circle when adjacent corners are filleted (something like the ends of a slot). This can be handy dandy. There are others like this around. For my use this was better than a few of the ones I tried. You may need to change the FILLETPOLYARC=0 if you have issue using this with Radius=0. In those situations when I had an issue, the LISP just doesn't do anything to those fillets, so I just go back with a small radius and change them, then you should be able to Fillet=0 those. (defun c:MF () (c:MultiPolyFillet) ) (defun c:MultiPolyFillet (/ radius ss i ent) (setq radius (getdist "\nFillet radius: ")) (if radius (progn (setvar "FILLETRAD" radius) (setq ss (ssget '((0 . "LWPOLYLINE,POLYLINE")))) (if ss (progn (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i)) (command "_.FILLET" "_P" ent) (setq i (1+ i)) ) ) ) ) ) (princ "MultiPolyFillet complete.") (princ) ) (princ "\nMultiPolyFillet loaded. Type MultiPolyFillet or MF to run." ) (princ)4 points
-
Inspired by SWL210 tonight... An update to this one.... it is a bit more complex then just grabbing an entity or entering a text value... Went down the grread route which gave the results I want. Command is (entortext "Message" '(List 1) '(List 2) ) Message: Text message such as "Enter a value, or select some text" '(List 1) - Control characters to end the selection process in ASCII codes: 13 = Enter, 32 = Space ('List 2) - Text Control for selections: "A" - Alphabetical characters only (a, A - z, Z) as text entry or any text entity selection "N" - Numerical Characters only (1-9 .) as text entry, or pure numerical text entity selection "P" - Punctuation characters (< > , . / ?.....) as "A" but text is only punctuation "M" - Mathematical modifiers (+ - / *.....) as "A" but text is only numerical modifiers (I should change this t be the same as "N") "E" - any entity is selectable. Without E is selection is text only List 2 can be joined eg '("A" "M" "N" "P") to select any text (also '("N" "P") works and enter any text Special option: If 'N' is used only numerical text is selectable, 'A' will allow any text entity to be selectable. Combined also works for selecting any text (but only entering A-Z, 1-9 here no punctuation) For example "Select an entity or 'O' for Options") '(79 111) '("E") Note: Distinguishes between cases.... Note here 'O' for options, for example, excludes that as part of a text string to be returned - selection is ended on 'O' There are examples, entorent, entorstring, entorvalue to look at in there. Returns: If text is entered: '("text", ASCII of enter method (13, 32..), nil) If Entity is selected: '(<entity name>, point selected, insert point of selection If Escape pressed: ("Lucky escape" 27 nil) - escape is captured and returned to the calling function - handy if selecting in a while loop If that makes sense, have a play. Oh, and an easter egg for you which might or might not work... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun EntorCommand (/ *error* RunLispCommand RunNativeCommand MyCommand LispCheck Result ErrorMessage CommandStatus ) (defun *error* (Msg) (if (> (getvar "CMDACTIVE") 0) (command) ) ; ;; Cancel any native command still running. (cond ((null Msg) (princ "\nCommand ended with error.")) ((wcmatch (strcase Msg) "*BREAK*,*CANCEL*,*EXIT*" ) (princ "\nCommand cancelled.") ) (t (princ (strcat "\nCommand error: " Msg ))) ) ; End Cond (princ) ) ; End Defun *error* (defun RunLispCommand (LispFunction /) (apply LispFunction nil) ) ; End Defun RunLispCommand (defun RunNativeCommand (CommandName /) (command CommandName) (while (> (getvar "CMDACTIVE") 0) (command pause) ) ; End While ) ; End Defun RunNativeCommand (setq MyCommand (strcase (getstring "\nPausing Text Selection.\n(Command Line to) Enter Command: " ))) (setq LispCheck (vl-catch-all-apply 'eval (list (read (strcat "C:" MyCommand) )))) (if (and LispCheck (not (vl-catch-all-error-p LispCheck)) ) ; end and (progn ; LISP (setq Result (vl-catch-all-apply 'RunLispCommand (list (read (strcat "C:" MyCommand))))) (if (vl-catch-all-error-p Result) (progn ; LISP Error (setq ErrorMessage (vl-catch-all-error-message Result)) (if (wcmatch (strcase ErrorMessage) "*BREAK*,*CANCEL*,*EXIT*,*ABORT*" ) (princ (strcat "\nLISP command " MyCommand " cancelled: " ErrorMessage )) (princ (strcat "\nLISP Command " MyCommand " ended with an error: " ErrorMessage )) ) ; End If ) ; End Progn (progn ; LISP Completed (setq CommandStatus "completed") ) ; End Progn ) ; End If ) ; End Progn (progn ; Native AutoCAD Command (setq Result (vl-catch-all-apply 'RunNativeCommand (list MyCommand) )) (if (vl-catch-all-error-p Result) (progn ; Native Command Error (setq ErrorMessage (vl-catch-all-error-message Result)) (if (> (getvar "CMDACTIVE") 0) (command) ) ; Ends command if running (if (wcmatch (strcase ErrorMessage) "*BREAK*,*CANCEL*,*EXIT*,*ABORT*") (princ (strcat "\nCommand " MyCommand " cancelled: " ErrorMessage )) (princ (strcat "\nCommand " MyCommand " ended with an error: " ErrorMessage )) ) ; End If ) ; End Progn (progn ; Native Command Completed (setq CommandStatus "completed") ) ; End Progn ) ; End If ) ; End Progn ) ; End If (princ "\nEnded Command") (princ) ) ; End Defun ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Ent Or Text options: ;;msg: Message to user ;;EndString: ASCII character code List '(13 32....) that will end the selection process. Note: add upper and lower cases ;;TextTypes: A list of letters to accept A: Alphabet, E: Entities, M: Mathematical symbols, N: Numbers, P: Punctuation symbols (defun EntOrEnt (msg EndString / TextTypes)(EntorText msg EndString '("E"))) ; entities only ; Equivalent to EntSel + Escape! (defun EntOrStr (msg EndString / TextTypes)(EntorText msg EndString '("N" "M" "A" "P" "E"))) (defun EntOrVal (msg EndString / TextTypes)(EntorText msg EndString '("N" "M" "E"))) (defun EntorText ( msg EndString TextTypes / MyTextType EndLoop grsel sela sel MyEnt MyValue MyCharacters MyCommand enta entb pt lw MyList MyTextString EscapeCode NestedSelection) (setq EscapeCode nil) (if (= (type EndString) 'LIST) (progn) (setq EndString (list 13 32)) ;; 13: Enter, 32: Space ('T' in getstring) ) ; End String (if (= (type msg) 'Str) (princ msg) (princ (setq msg "Select or enter text: ")) ) (if (= (type TextTypes) 'LIST) (progn) (setq TextTypes (list "A" "N" "P" "M")) ;; A: Alphabet, N: Numerical, P: Punctuation, M: Mathemtatical ) ; End String ;;Starting values (setq MyValue "") (setq MyEnt (list)) (setq EndLoop "No") (setq MyCommand 0) (setq MyTextType nil) (if (or (member "N" TextTypes)(member "n" TextTypes)) (setq MyTextType (strcat (if (= MyTextType nil) "" MyTextType) "1234567890.,"))) ; Numerical (if (or (member "A" TextTypes)(member "a" TextTypes)) (setq MyTextType (strcat (if (= MyTextType nil) "" MyTextType) "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))) ; Alphabet (if (or (member "P" TextTypes)(member "p" TextTypes)) (setq MyTextType (strcat (if (= MyTextType nil) "" MyTextType) "`#`~`@\\|<`,>`.`?/¬``!\"£$%^&`*()`-_="))) ; Punctuation (if (or (member "M" TextTypes)(member "m" TextTypes)) (setq MyTextType (strcat (if (= MyTextType nil) "" MyTextType) "=/+-`*`.`,"))) ; Maths Functions (if (or (member "E" TextTypes)(member "e" TextTypes)) (setq MyTextType (strcat (if (= MyTextType nil) "" MyTextType) ""))) ; Entity (implied in code if not listed) (if (= MyTextType nil)(setq MyTextType "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ")) ;;Loop for grread function (while (= EndLoop "No") (setq grsel (vl-catch-all-apply 'grread '(nil 13 2))) ; catch errors (escape key) (if (vl-catch-all-error-p grsel) ;; escape pressed, end loop (progn (setq EndLoop "Yes") (princ (strcat "\n" (setq MyValue "Lucky escape"))) (setq escapecode 27) (setq MyEnt nil) (if lw (redraw lw 4) ) ) ;end progn escape pressed (progn (setq sela (car grsel)) (if (= sela 5) ; Highlight on hover (progn (if lw (redraw lw 4) ) ;Remove any highlight (if (and (setq pt (cadr grsel) ) (setq lw (ssget pt)) (setq lw (ssname lw 0)) ) ; end and (redraw lw 3) ) ; end if ) ; end progn ) ; end if (if (or (= sela 2)(= sela 3) ) ; text entry or mouse click (progn (setq sel (nth 1 grsel)) (if (= (type sel) 'LIST) (progn (setq MyList '("TEXT" "MTEXT" "RTEXT" "ATTRIB" "ATTDEF" "DIMENSION" "INSERT")) ; list of entity types allowed to select (if (or (member "E" TextTypes)(member "e" TextTypes)) (setq MyList (append MyList (list "LINE" "POLYLINE" "3DPOLYLINE" "LWPOLYLINE" "MLINE" "SPLINE" "POLYGON" "MPOLYGON" "VIEWPORT" "WIPEOUT" "ELLIPSE" "CIRCLE" "ARC" "POINT" "HATCH" "SURFACE" "SOLID3D" "SHAPE" "FACE" "3DFACE" "SOLID" "3DSOLID" "TRACE" "RAY" "XLINE" "RASTER" "XREF" ))) ) ;;SP TO complete this list with: ;;ACAD_PROXY_ENTITY, BODY, HELIX, IMAGE, LEADER LIGHT, MULTILEADER, MLEADERSTYLE, ;;OLEFRAME, OLE2FRAME, REGION, SECTION, SEQEND, SHAPE, SUN, TABLE, TOLERANCE,UNDERLAY, VERTEX, (setq MyEnt (nentselp sel)) (cond ((or (= nil MyEnt) (= (member (cdr (assoc 0 (entget(car MyEnt)))) MyList) nil) ) ; Endor (progn (Princ "\nMissed! Try again.\n")(princ msg) ;; or add in here 'ssget' (setq MyEnt nil) ) ) ( T ;; Text selected (if (equal TextTypes '("E"))(princ ": Ahh, you selected a thing")(princ ": Fantastic selecting ability.")) ;;Check if numerical only selection (if (or (equal TextTypes '("N")) (equal TextTypes '("n")) ) ; endor (progn (setq entb (last (last (nentselp (last grsel))))); grsel point value (if (and (/= entb nil) (/= (type entb) 'real)) (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION,*LEADER")(setq MyEnt (list entb (last grsel)))) (progn) ) (setq MyTextString (cdr (assoc 1 (entget (car MyEnt)))) ) (setq mytextString (LM:Unformat MytextString nil)) ; Unformat string (if (or (wcmatch (strcat MyTextString) "*[~1234567890`.`,]*") (and (vl-string-search "." MyTextString) (vl-string-search "." MyTextString (+ (vl-string-search "." MyTextString) 1)) ) ; end and ) ; endor (progn (princ (strcat " However, selection is not numerical,\n" Msg ", or [esc]: ")) (setq MyEnt nil) ) ; end progn (progn (setq EndLoop "Yes") ) ) ; end if number check ) ; end progn numerical (progn (setq EndLoop "Yes") ) ; end progn ) ; end if ) ; end cond T ) ; end conds (if lw (redraw lw 4)) ; remember to (redraw xyz 3) in originating code to keep highlight (setq sel nil) ) ; end progn ; selection is list (progn (setq MyCharacters (list 137)) ; list of single characters to accept (if (member 32 Endstring)(progn)(setq MyCharacters (cons 32 MyCharacters))) ; add [space] if 't' (if (or ;;limit characters able to able to be used ;; remove escape keys later (wcmatch MyTextType (strcat "*" (strcase (chr sel)) "*"));; Strcase to include caps (= sel 92) ; '\' character for commands (member sel MyCharacters) ) ; endor (progn (if (= sel 92) ;; If double '\\' enter commands - check if '\' entered (progn (setq MyCommand (+ MyCommand 1)) (if (= MyCommand 2) (progn (princ (chr 8)) ; remove last '\' from command line (setq MyValue (vl-string-right-trim (chr 92) MyValue)) ; remove '\' from result (EntorCommand) (setq MyCommand 0) (setq sel nil) (princ "\nResume Text Selection.\n")(princ MSG)(if MyValue (princ MyValue)) ) ; end progn command = 2 (progn (if (member sel EndString) ;; remove escape keys from MyValue (progn) (progn (princ (chr sel)) (setq MyValue (strcat MyValue (chr sel) )) ) ; end progn ) ; end if ) ; end progn ) ; end if ) ; end progn (progn (setq MyCommand 0) (if (member sel EndString) ;; remove escape keys from MyValue (progn) (progn (princ (chr sel)) (setq MyValue (strcat MyValue (chr sel) )) ) ; end progn ) ; end if ) ; end progn ) ; end if ) ) (if (member sel EndString) ; enter (progn (setq EndLoop "Yes") (setq EscapeCode sel) ) ; end progn (progn ) ) ; end if (if (= sel 8) ; backspace (progn (if (> (strlen MyValue) 0) (progn (setq MyValue (substr MyValue 1 (- (strlen MyValue) 1))) (princ (chr sel)) ) ; end progn ) ; end if ) ; end progn (progn ) ) ; end if ) ; end progn ) ; end if list ) ; end progn ) ; end if text / mouse entry ) ; end progn ) ; end if catch-all-error ) ; end while (if (or ( = (length MyEnt) 0)(= MyEnt nil)) ;; if no entity selected.. text entry (progn ;; If text is entered ) ; end progn (progn (setq enta (car MyEnt)) (setq pt (cdr (assoc 10 (entget enta))) ) (setq entb (last (last (nentselp pt)))) ;; use sel? ;; nested entities (if (and (/= entb nil) (/= (type entb) 'real) (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION,*LEADER") ) ; end and (setq MyValue entb) ; If entity is DIM, Table, Leader (setq MyValue enta) ; ELse entity ) ; end if ) ; end progn ) ; end if ;;Result - '(MyValue Pt) ;;'Ended ##' : An escape character code if entered ;;'Lucky Escape' : Escape key pressed ;;<Entity name: ##> : The selected entity ;;Other character : Entered Characters ;;(cadr grsel) - mouse point ;;pt - entity insert point (assoc 10) (if EscapeCode (setq MyValue (list MyValue EscapeCode nil)) (setq MyValue (list MyValue (cadr grsel) pt)) ) MyValue ) Al Still thinks this is a native command "EntOrText" by the way...3 points
-
3 points
-
Attached is code SlbShow.lsp that ChatGpt help me generate which would run on AutoCAD on Windows OS. It'll first open a file window to select an existing slide library file like acad.slb Then run a vbscript to extract the names of the slides inside the selected slide library and place this into a text file. Next, the slides inside the selected slide library will be displayed in a custom dcl made up of a row of 4 x 5 column image buttons. Finally, when an Image button is clicked another window appears showing the slide in a larger image button view. I would like to know when vbscript or wscript is restricted does the code handle this and exit properly. Any other feedback is welcome. SlbShow.lsp2 points
-
Just putting this up here as something I wanted for a while and had 10 minutes to think last night. I'd been wanting a routine "Select an entity or enter a value". Been doing it with initget which gives discrete values and not every possibility. So made up the following. All good so far, haven't found out where it is broken yet. Just to get your brains working then, trying to figure out how to change the mouse pointer as it hovers over an entity and not select it? Using grread and it's options you either get mouse pointer change and it selects automatically or no mouse pointer change and select with a mouse click as far as I can see. Any ideas? Thanks (defun c:EntOrValue ( / msg MyResult) (setq msg "\nSelect an Entity or enter a value: \n") (setq MyResult (EntorValue msg) ) ; end defun ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun EntorValue ( MSG / EndLoop sel MyEnt MyValue enta entb pt) (setq MyValue "") (setq MyEnt (list)) (setq EndLoop "No") (princ MSG) (while (= EndLoop "No") ; start loop (setq sel (nth 1 (grread nil 0 2))) ; read keyboard / mouse inputs. Ignore mouse position, only if clicked (if (= (type sel) 'LIST) (progn ; if sel is a LIST,... ie. a mouse click, a point returned (setq MyEnt (nentselp sel)) ; select entity from point (if (= nil MyEnt) (Princ "\nMissed! Try again. Select text or enter a value: ") ; entity not selected (setq EndLoop "Yes") ; entity selected, end while loop ) ; end if ) ; end progn (progn ; if sel is not a LIST, i.e. a single keyboard entry (if (or (and (> sel 47)(< sel 57))(= sel 46)) ; numbers only (progn (princ (chr sel)) (setq MyValue (strcat MyValue (chr sel) )) ) ) (if (= sel 45) ; -ve ; make negative number (progn (setq MyValue (strcat (chr sel) MyValue )) (princ " Making -ve\n")(princ MyValue) ) ; end progn ) ; end if (if (= sel 13) ; enter - end number input, end loop (progn (setq EndLoop "Yes") ) ; end progn ) ; end if ) ; end progn ) ; end if list ) ; end while (if ( = (length MyEnt) 0) ; if entity not selected (progn MyValue ; return number entered ) ; end progn (progn ;;GetEnt code (setq enta (car MyEnt)) (setq pt (cdr (assoc 10 (entget enta))) ) ;;fix for nenset or entsel requirements (setq entb (last (last (nentselp pt)))) ;; use sel? (if (and (/= entb nil) (/= (type entb) 'real) ) (progn (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION,*LEADER")(setq enta entb)) ) ) (setq MyEnt enta) MyEnt ; return entity name, including nested say text from dimensions ) ; end progn ) ; end if )2 points
-
I think that the will to simplify the proccess of controling our environment (Ribbons,Menues,Varaibles,Lisps Etc.) can leed to more complications... and I also feel it loose it's original goal wich is to control our cad environment. It started with how to manage our lisp's, CUI (ribbon and menues) and varaibles setting and ended up with cloud-based app that (in my eyes...) only add complictions and I didn't fully understand its goal... to control the lisps - one autoload lisp file do it, and for organizations it can sit in a shared location. simple documantation file like excel or other formats can use to tell users what each lisp dose . organazations have system administrators for that. about settings: Bricscad have On_Doc_Load & on_start files, Autocad have its equivalents, and that is where varaibles can be set automatically. about the Ribbon and menues: CUI files can be deployed and loaded. there are other ways to progrematically do it like mentioned here through the registry and more, but I feel that some significant overshoot was displayed here. and do it through the cloud also raise some doubts for me.2 points
-
Thanks for the link, I am happy with this code for now: (defun EntorValue ( MSG / EndLoop sel MyEnt MyValue enta entb pt) (princ MSG) ; message (setq MyValue "") (setq MyEnt (list)) (setq EndLoop "No") (while (= EndLoop "No") (setq grsel (grread nil 4 2)) ; Read from mouse or keyboard entry (setq sela (car grsel)) ; type of entry (if (or (= sela 2)(= sela 3) ) ; text entry or mouse click (setq sel (nth 1 grsel)) ; what was entered, a point, or text ) (if (= (type sel) 'LIST) (progn (setq MyEnt (nentselp sel)) ; if mouse entry selected en entity (if (= nil MyEnt) (Princ "\nMissed! Try again: ") (setq EndLoop "Yes") ) ; end if ) ; end progn (progn (if (or (and (> sel 47)(< sel 57))(= sel 46)) ; if keyboard entry is a number (progn (princ (chr sel)) (setq MyValue (strcat MyValue (chr sel) )) ) ) (if (= sel 45) ; -ve ; if keyboead entry is '-' add '-' to beginning of string ;;Future check to be done if using A-Z keyboard entry, not just numbers ;;Future check in case number is allready -ve (progn (setq MyValue (strcat (chr sel) MyValue )) (princ " Making -ve\n")(princ MyValue) ) ; end progn ) ; end if (if (= sel 13) ; enter ; end keyboard entry. Note mouse selection cancels keyboard entry (progn (setq EndLoop "Yes") ) ; end progn ) ; end if ) ; end progn ) ; end if list ) ; end while (if ( = (length MyEnt) 0) (progn MyValue ; return MyValue ) ; end progn (progn ; entget for nested entities ; Also see Lee Mac CTX for alternative method ;;GetEnt code (setq enta (car MyEnt)) (setq pt (cdr (assoc 10 (entget enta))) ) ;;fix for nenset or entsel requirements (setq entb (last (last (nentselp pt)))) ;; use sel? (if (and (/= entb nil) (/= (type entb) 'real) ) (progn (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION,*LEADER")(setq enta entb)) ) ) (setq MyEnt enta) MyEnt ; return entity name ) ; end progn ) ; end if )2 points
-
2 points
-
1 point
-
Sorry Nikon I removed a call to another sub function at the start that had the vl-load-com.1 point
-
I like that one @mhupp. Luckily our waterjet and plasma don't seem to have issues, but smoothing couldn't hurt. I had the same error as Nikon, so I cleaned this up a bit. PolySmooth_1.0.lsp1 point
-
I made this to run on our CNC profiles. It would always throw a tool path error if the polyline had corners the tool couldn't fit into. Because our profiles where generated from a laser outline and then cleaned by hand. A lot of the poly segments were very small and tedious to fix. using poly fillet would update all vertex and fillets to the radius you set. so if your profile had a larger radi it would create big wings. (see example) This only fillets if the radi is smaller then the tool dia or if two joined line segments can run fillet command. creates an old red outline poly on check layer to compare against. leans heavily on vlax-curve visual lisp functions. I think this took me about 2 week on and off to write up. updating the one profile could take 10 mins to multiped hours to fix manually. switching between AutoCAD and the CNC software to see if it would throw an error or finally pass. I think it became obsolete with the update to the CNC software. example.dwg PolySmooth.lsp1 point
-
@BIGAL I think using powershell method would be similar. User launches AutoCAD then runs lisp that would write the registry key (that designates the current profile) into powershell script along with item to add to Startup. But after running the powershell script, user is prompted to exit AutoCAD (without launching Appload) in order for the added item in the registry to be read on the relaunch of AutoCAD.1 point
-
1 point
-
For CAD manager, Developer, and Users accustomed to communicating via email, feel free to contact me anytime: vico@vedacad.com1 point
-
I continue to monitor the situation and although we're still seeing the error message, the stats for this month indicate that bot activity is going down from a peak in September. Fingers crossed it continues to fall.1 point
-
@LIU very simple. If UCSICON is set to OR (origin) and 0,0,0 of the current UCS is near to the left border of the graphics window boundary, or below the boundary, or not within the viewing window then the UCS ICON will move to be near the bottom left of the window and will not be postioned at 0,0. Note, the little square that you see on the icon indicates that you the WCS is active.1 point
-
@VicoWang Hi. 1. the first post of this thread talked about controling the lisps and varaibles of a single user and that was my main focus. 2. in your comment above, section 1 (and @Paul Li also refered to it in this thread) you talk about development environment and app deployment, and that is a different topic. I'm a single user, so I can't talk that much about working in a big firm\company, and how big organizations should deal with the issues you raised.1 point
-
@aridzv You have developed a plugin and distributed it to 1000 users. When you need to update this plugin, or you want to know exactly how many devices have genuinely downloaded your plugin. When you change devices (I know your method, but VedaCAD's method is to log in to VC, click sync, and the deployment of all configurations including custom shortcut keys is completed). You manage the computers of 100+ employees in the entire company (offices may be in different cities or even different countries), providing employee A with (construction group plugins and standard sets), and employee B with (structural group plugins and standard sets). When you formulate, manage, and update the drafting standards of subcontractors, and even need to retrieve the specific drafting standards version of a project from 3 years ago. When your OneDrive or shared drive is locked offline due to errors, such as network fluctuations, or when you need to work outside the office. It's just that your own usage scenario is sufficient without the need for the cloud. The real logic of VedaCAD is a local sandbox managed by the cloud: it has 99.99% of the availability of the cloud, as well as the I/O execution speed of local files.1 point
-
@aridzv I also like to use the autoload function. But instead of including those lines of code in a lisp file that is added to the Startup Contents window under Appload, I include those lines of code inside the mnl files. Since I'm loading partial menus as long as the mnl file name matches the partial menu cuix file name, then AutoCAD automatically loads the contents inside the mnl file without the need to add the file under Appload. Unfortunately, this feature only works with AutoCAD but not with LT. Hopefully in the near furture Autodesk will incorporate the support of mnl files as well with LT.1 point
-
about loading lisps: I use a lisp file with autoload lines for each lisp looks like this: (defun c:lisps_autoload ();;Autoload all lisp files (autoload "3D2D" '("3D2D")) (autoload "3dplifstraight" '("3dplifstraight")) (autoload "add_SYS_ATT" '("add_SYS_ATT")) . . . . ) (c:lisps_autoload) this file have about 190 lines to autoload lisps - can have much more of course.. this file sits in place that is part of the cad path and I need to APPLOAD only this lisp - then all my lisps are availble on demand. not loaded wich take memeory but wating to be called and only those I call are loaded. about CUI: I have my custom CUI file and when I make new installtion (happens every 3 yeers...) I finish the intalation and copy the CUI file to new location and with "Customize" commad load it and done. the same with my lisp's folder - copy it the new location, use APPLOAD once to load the autoload lisp file mark the "Autoload" check box and finish. copy one CUI file,one lisps folder,set my CUI to mine,APPLOAD one lisp file and done. About dependencies: If a lisp is called from other lisp but didn't load before (didn't call it or it is a function lisp that will never be called by a user) I use this code to check if it is loaded and if not load it: (if (or (not breakallfunc) (not BREAK_WITH));; if breakallfunc command or BREAK_WITH command are not loaded load breakall.lsp (load "breakall.lsp") )1 point
-
@BIGAL I'm only able to successfully add the file by do the following: 1) Right after adding the file using the lisp function, don't run Appload but close out of AutoCAD and re-start it 2) Manually add the file using Regedit, and if AutoCAD is running, don't run Appload but close and restart AutoCAD AutoCAD seems to have a hold of what goes on inside the Startup Suite window.1 point
-
You will see lots of references to use ACADDOC.lsp which if you add all your lisps to it will load on startup, but I prefer to leave all custom loads outside of the inbuilt ones. There is another one also. When updating new version of CAD ignoring download "Install" time using a "Install lisp" and manually updating startup suite, plus a couple of other things like end users preferred toolbars, only took about 3 minutes and was all set up. @Paul Li this is Bricscad location I will try making a lisp to update. There was also a mention of a DFS file. The file name "Autoload" was just for convenience can use any reasonable name. Computer\HKEY_CURRENT_USER\Software\Bricsys\BricsCAD\V25x64\en_US\Profiles\Default\Dialogs\Appload\Startup1 point
-
Dont forget about DUMPIT.lsp that shows the properties via VL. I use it often reveals lots of info. DumpIt.LSP1 point
-
FYI, I used to run the LIST command quite a bit to give me information about the object(s) in question. But with the introduction of the Properties command in AutoCAD 2000, I slowly got used to leaving the Properties window opened/docked in the drawing area. Then as an object is selected, it's "properties" would automatically be filled out for me to inspect inside the Properties window. There's no need to run an extra command sequence like the LIST command which then would have to display the information on on a separate Text screen. In addition, the Properties window makes it possible for you to enter new values into those property items that can be modified.1 point
-
Just thought of another trick I've used in the past. I would let AutoCAD create a brand new outline of the area to be hatched for me with the Boundary command. But in the Boundary Creation window under Boundary set, do not use the default Current viewport setting. But instead click on the New button and then select only the objects that form the hatch area outline. This restricts AutoCAD to only consider those objects selected to generate the new boundary. Leave the Object type as Polyline and usually with this new Pline boundary generated, the Hatch creation completion success rate would increase just a tad more.1 point
-
When I run into a situation like this, the complexity or the effort can become too much, especially if there's a deadline. In that case I'll draw a polyline along the border and use that as the boundary for the hatch. Of course the polyline goes on a nonplotting layer.1 point
-
1 point
-
Testing a new version of PyRx’s KDTree. Maybe a useful example import traceback import pandas as pd from pyrx import Ap, Db, Ge, Ed @Ap.Command() def doit(): try: # 1. Select the text and block objects in AutoCAD ps, ss = Ed.Editor.select([(0, "MTEXT,INSERT")]) if ps != Ed.PromptStatus.eOk: return # 2. Extract block positions for spatial matching pnts = Ge.Point3dArray() for blkid in ss.objectIds(Db.BlockReference.desc()): blkref = Db.BlockReference(blkid) pnts.append(blkref.position()) # Build a spatial K-d tree to find the nearest block for each MText tree = Ge.Point3dTree(pnts) # 3. Process matched data into a structured list rows = [] for tid in ss.objectIds(Db.MText.desc()): mt = Db.MText(tid) indexes, _distances = tree.knnSearch(mt.location(), 1) if indexes: row_data = {} nearest_pt = pnts[indexes[0]] # split TODO: /P text_lines = mt.text().splitlines() for idx, line in enumerate(text_lines): row_data[f"Line_{idx + 1}"] = line row_data["Block_X"] = round(nearest_pt.x, 2) row_data["Block_Y"] = round(nearest_pt.y, 2) row_data["Block_Z"] = round(nearest_pt.z, 2) rows.append(row_data) df = pd.DataFrame(rows) print(df) output_file = "e:/temp/output_cad_data.xlsx" df.to_excel(output_file, index=False, sheet_name="CAD Extract") print(f"Successfully exported {len(df)} rows to {output_file}") except Exception as e: traceback.print_exc()1 point
-
Going back to an old post here, Al. !! I've been updating the above this week - didn't realise how old it was till I came back here. Made a modification to add the commands: EntOrValue (command line ENTry OR select text with a numerical VALUE), EntorText (as before, but select any text), EntorEnt (as before but select any entity) and EntOrPoint (as before but return a point) - pretty much using this base but with filters, and of course, standing on the back of Lee Mac (who was also standing on the back of others for his GRRead LISP giving snaps.. most excellent). So doing some reading at lunch... and warning here... Bings Co-Pilot is quoting the above 'EntOrValue' as if it is a native AutoCAD command... "To select an entity or allow text entry in AutoCAD using LISP, you can use the entorvalue function." (Obviously I am now writing 'AutoCAD Function EntOrValue' as much as I can to screw up the system). (and a thanks to Lee Mac for the work he did on Grsnaps)1 point
