All Activity
- Past hour
-
Nice test @PGia, thanks! For some reason I didnt consider closed polylines in the _checkOffset function, so I added an extra check there. Should work as expected now: Not sure about the short corner. The lines are so narrow the centerline is pushed back out of the point. Seems to be logical to me but it does feel intuitive. Narrow indents don't get much love from the centerline. So "inlets" don't have enough influence on the shape of the line. What would the expected result be? Below makes sense since there is not enough space to go into the indent. Or are you maybe something like this where the line splits and goes into the hole:
-
Here is the button macro for selected objects, so something like BIGAL's recommendation should work. ^C^C_SELECT;_MOVE;0,0,0;0,0,1e99;_MOVE;P;;0,0,0;0,0,-1e99;
- Today
-
@Tsuky thank you very much, your code changes the precision of the fields from 2 to 1. I replaced 2 lines in the code to change the precision from 1 to 2. (if (setq nbs (vl-string-search "%pr2" value_string (setq tmp_nbs nbs))) (setq value_string (vl-string-subst "%pr1" "%pr2" value_string tmp_nbs) * * * * * * * * * * * * * * * * (if (setq nbs (vl-string-search "%pr1" value_string (setq tmp_nbs nbs))) (setq value_string (vl-string-subst "%pr2" "%pr1" value_string tmp_nbs) * * * * * * * * * * * * * * * * You've been very helpful!
-
Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working
Saxlle replied to Clint's topic in AutoLISP, Visual LISP & DCL
You're welcome @Clint . Yes, the DCL file are not necessary every time, but it can be helpful and user-friendly to accomplish desired result (like this one from an example video from above) if you have multiple choosing (for eg. buttons or check-boxes for Uppercase, Lowercase, Renaming, etc.). Best regards. -
You can try this. (vl-load-com) (defun c:change_prec ( / ss AcDoc Space n ename Obj value_string nbs tmp_nbs) (princ "\nSelect MText.") (while (null (setq ss (ssget (list '(0 . "*TEXT") (cons 67 (if (eq (getvar "CVPORT") 1) 1 0)) (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model")) ) ) ) ) (princ "\nAren't MText or Text!") ) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ) (vla-startundomark AcDoc) (repeat (setq n (sslength ss)) (setq ename (ssname ss (setq n (1- n))) Obj (vlax-ename->vla-object ename) ) (setq value_string (vla-FieldCode Obj) nbs 0) (cond ((eq (substr (vla-FieldCode Obj) 1 3) "%<\\") (while nbs (if (setq nbs (vl-string-search "%pr2" value_string (setq tmp_nbs nbs))) (setq value_string (vl-string-subst "%pr1" "%pr2" value_string tmp_nbs) nbs (1+ nbs) ) ) ) (vlax-put Obj 'TextString value_string) ) ) ) (vla-endundomark AcDoc) (prin1) )
-
Hi BIGAL, Your point is well received! Best regards, Clint Hill
-
Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working
Clint replied to Clint's topic in AutoLISP, Visual LISP & DCL
Hi Gentlemen, Your code contributions for my learning is greatly appreciated! Hi Saxlle, I thank you for the nice video demonstration as well as the excellent program. It appears that my focus should be more on Visual LISP along with including the Dialog box code within the main program file. Best regards, Clint Hill -
Saxlle started following Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working
-
Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working
Saxlle replied to Clint's topic in AutoLISP, Visual LISP & DCL
Maybe this kind of solution can be interesting (to use a multiple selection, use Shift+Left mouse click, to use a single selection, use CTRL+Left mouse click): ; ************************************************************************** ; Functions : CHRENLAYERS ; Description : Select Layers To Change It To UPPERCASE Or LOWERCASE ; Author : SAXLLE ; Date : December 04, 2025 ; ************************************************************************** (prompt "\nSelect Layers To Change It To UPPERCASE Or LOWERCASE!\nTo run a LISP type: CHRENLAYERS") (princ) (defun c:CHRENLAYERS ( / old_echo dcl_id fname fn laylist lay items rval acad name) (vl-load-com) (setq old_echo (getvar 'cmdecho)) (setvar 'cmdecho 0) (create_dialog) (collect_layers) (setq dcl_id (load_dialog fname)) (if (not (new_dialog "Laylist" dcl_id)) (exit) ) (action_tile "cancel" "(cancel)") (start_list "ls") (mapcar 'add_list laylist) (end_list) (action_tile "ps1" "(read_items) (to_uppercase)") (action_tile "ps2" "(read_items) (to_lowercase)") (start_dialog) (unload_dialog dcl_id) (vl-file-delete fname) (gc) (princ) ) (defun cancel () (done_dialog 0) (terpri) (prompt "Application running were finished...") (princ) ) (defun collect_layers () (setq laylist (list) lay (tblnext "LAYER" T) ) (while lay (if (not (equal (cdr (assoc 2 lay)) "0")) (setq laylist (cons (cdr (assoc 2 lay)) laylist) lay (tblnext "LAYER") ) (setq lay (tblnext "LAYER")) ) ) (setq laylist (vl-sort laylist '<)) ) (defun read_items () (setq acad (vla-get-activedocument (vlax-get-acad-object))) (setq items (get_tile "ls") rval (mapcar '(lambda (x) (nth x laylist)) (read (strcat "(" items ")"))) ) ) (defun to_uppercase () (foreach item rval (setq name (strcase item)) (vla-SendCommand acad (strcat "-RENAME LA " item (chr 13) name (chr 13))) (prompt (strcat "\nThe layer " item " were changed into the UPPERCASE!")) (setvar 'cmdecho old_echo) (princ) ) (done_dialog 1) ) (defun to_lowercase () (foreach item rval (setq name (strcase item T)) (vla-SendCommand acad (strcat "-RENAME LA " item (chr 13) name (chr 13))) (prompt (strcat "\nThe layer " item " were changed into the LOWERCASE!")) (setvar 'cmdecho old_echo) (princ) ) (done_dialog 1) ) (defun create_dialog () (setq fname (vl-filename-mktemp "Laylist.dcl") fn (open fname "w") ) (write-line "Laylist :dialog { label = \"Select layers to change it to UPPERCASE or LOWERCASE!\"; :list_box { key = \"ls\"; multiple_select = true; height = 10; width = 50; } :row { :button { label = \"Change to UPPERCASE >>\"; key = \"ps1\"; fixed_width = true; } :button { label = \"Change to LOWERCASE >>\"; key = \"ps2\"; fixed_width = true; } :button { label = \"Cancel\"; key = \"cancel\"; mnemonic = \"C\"; alignment = centered; fixed_width = true; is_cancel=true; } } }" fn) (close fn) ) Also, you can see the short video example of how it works. CHRENLAYERS.mp4 Best regards. -
The fields are in the text, not in the block. The sample fields.dwg is attached in the first post. The problem is that you need to change the accuracy of several fields at the same time.
-
If you can identify where the field strings are then you could update them, you can look for say "AcExpr" in the string then replace pr1. Maybe use Bedit and Attsync to update blocks. Similar for Mtext. So where are they ? Provide a sample dwg, You should be able to do something by now look at (Vlax-get obj 'textstring)
-
It would be best to start a new post asking questions about making layers. Me like many others have defuns to make layers on the fly. If you describe what your trying to do I expect a quick response. Admin please move post.
-
cui panel image
mohammadreza replied to mohammadreza's topic in The CUI, Hatches, Linetypes, Scripts & Macros
yes, they are true . In other versions of AutoCAD, everything works properly, but I need to share my CUI and I cannot require everyone to use a single AutoCAD version. -
I have dozens of fields that need to be adjusted for accuracy. It will take a long time to edit each field...
-
Clint started following PROBLEM RENAMING LAYERS
-
Gentlemen, I must try to interpret each of your generous examples. These are very involved lines of code to this (older) novice. I will study CHAR as it appears to be key to text case definitions. Clint P.S.: Have any here heard of, used or now use the tried and true 20+ year old LAYECREATOR.LSP program?
- Yesterday
-
Might as well join the party, yes easy task, but missing. is co-ords to be labelled in some way so know which co-ords match which point.. Need you to post a proper dwg with desired table all set up, text height, column widths and so on.
-
@dexus Your animations are really original although I don’t think I managed to see exactly the same thing you showed in your video. But that doesn’t matter. Today I had the whole afternoon free, and I decided to try to “stress-test” your code. I drew several irregular margins and also tried to draw something resembling a “inlet” like the ones GLAVCVS mentions. However, the result was very consistent. In no case was it possible to make the centerline “lose orientation.” It only failed in the case of closed margins, as shown in the attached image. But I assume this happens because you didn’t consider that possibility, given the context of the rest of my examples. Also, there are a few minor details in some wide curves where the centerline clearly drifts away from the middle. Overall, the result is EXCELLENT. Regarding the “inlets” that @GLAVCVS mentions, I suppose it would be great to have a tool capable of robustly handling those cases. But, normally, these situations only occur in a few places and can be handled manually. In any case, a tool like that would definitely put its author’s name on the map. PS: I've attached the drawing of the image. AxisExple3.dwg
-
Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working
BIGAL replied to Clint's topic in AutoLISP, Visual LISP & DCL
removed -
It could be as simple as changing "all" to "ss", where ss is a selection set. I am no expert on setting the exclude objects in a selection set. try this not really tested. (setq ss (ssget "_X" '((-4 . "<NOT") (0 . "3DSOLID") (-4 . "NOT>")))) or _move;(setq ss (ssget "_X" '((-4 . "<NOT") (0 . "3DSOLID") (-4 . "NOT>"))));;0,0,0;0,0,1e99;_move;ss;;0,0,0;0,0,-1e99
-
Steven P started following Changing the precision of fields and Lisp command for coordinates
-
As above, need more information as where the data is coming from and how you want the LISP to run. The one I use "EOLA", "EOLB" (End "A" of line and End "B" of line) I run by pick line, pick text to replace - having created the template before hand (well, LISP does that). Might be you want the coordinates of circles and the table to be created in the order you select them, or ordered left to right, right to left, so could do with a bit more to work with.
-
"pr2" is precision - here 2 places, "pr1" at the end of the first expression is 1 decimal place
-
Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working
Steven P replied to Clint's topic in AutoLISP, Visual LISP & DCL
You could try the search function... maybe this thread from lasty week might help? -
ZPK104 joined the community
-
Help with 3D spur gear drawing (no tooth width given) !!
Nlevismith95 replied to Nlevismith95's topic in AutoCAD 3D Modelling & Rendering
-
EmeraldSynth joined the community
-
Help with 3D spur gear drawing (no tooth width given) !!
Nlevismith95 replied to Nlevismith95's topic in AutoCAD 3D Modelling & Rendering
Below is the radius I keep getting after using a 60 item polar array for the width. I then drew 3 point arcs from offset line to the pitch intersection and then the root. I think this is where I'm going wrong, but don't know how to correct it. -
markevans66 joined the community
-
leonucadom started following Please help with this z0
-
hello all: I use this routine to lower all selected objects to z0 The problem is that it also affects 3D solids if I have them. Is there a way to modify the code excluding 3D solids from the selection? _move;_all;;0,0,0;0,0,1e99;_move;_p;;0,0,0;0,0,-1e99 I appreciate the comments and hope they can help me.
-
Nlevismith95 started following fuccaro
-
Help with 3D spur gear drawing (no tooth width given) !!
Nlevismith95 posted a topic in AutoCAD 3D Modelling & Rendering
As the title states, I am trying my best to create this drawing for my AutoCAD class, but I am having no luck due to missing information and my lack of skills. This is the first module where we are covering 3D modeling so the textbook has been no help other than basic commands. What I am most frustrated with is not having the tooth width. I have started by drawing the diameters of the circles. Then I drew a line from center to outside most circle quadrant. From there I used polar array on the line with 60 items to hopefully get the tooth width or a way of drawing the arcs, but I am having no luck. I realize I am probably going about this wrong, so any help would be much appreciated. The lack of information in this class has been very frustrating for a beginner like myself. In what situation would I not have the tooth width when drawing? Why do I have to derive information when I'm just learning the software.... Anywho, please help me before I go insane. Thanks!!!!
