Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Emmanuel Delay

    select text as block name

    Based of this code by Lee Mac. I changed it to do what you ask for. - copy-paste this code to a file named select-text-as-block.lsp (or whatever, just make sure it has the .lsp extension), - Drag this file to your drawing - type command otbs, press enter, then follow the instructions. (select the objects; select the text object, select a point on screen) ;; Objects to Block - Lee Mac ;; Converts a selection of objects to a block reference. ;; adapted by Emmanuel Delay : obj2blk separated from c:obj2blk (defun add_attdef ( / ip tag prmpt dfault) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 10 '(0.3 4.3 0.0)) (cons 70 0) (cons 1 "") (cons 2 "NUM") (cons 3 "Number: ") (cons 40 2.0) ) ) ) ;; @params: s: selection, n: name, p: point (defun obj2blk (s n p / e i l s x ) (if (and s (progn (while (not (or (= "" n) (and (snvalid n) (null (tblsearch "BLOCK" n)) ) ) ) (princ "\nBlock name invalid or already exists.") ) (if (= "" n) (setq n "*U") ) p ) ) (progn (entmake (list '(0 . "BLOCK") (cons 10 (trans p 1 0)) (cons 02 n) (cons 70 (if (wcmatch n "`**") 1 0)) ) ) (repeat (setq i (sslength s)) (entmake (entget (setq e (ssname s (setq i (1- i)))))) (if (= 1 (cdr (assoc 66 (entget e)))) (progn (setq x (entnext e) l (entget x) ) (while (/= "SEQEND" (cdr (assoc 0 l))) (entmake l) (setq x (entnext x) l (entget x) ) ) (entmake l) ) ) (entdel e) ) (add_attdef) (if (setq n (entmake '((0 . "ENDBLK")))) (entmake (list '(0 . "INSERT") (cons 02 n) (cons 10 (trans p 1 0)) ) ) ) ) ) (princ "\nBlock made: ") (princ n) ) (defun c:otb ( / s n p) (setq s (ssget "_:L" '((-4 . "<NOT") (0 . "ATTDEF,VIEWPORT") (-4 . "NOT>")))) ;;(setq s (ssget "_:L" '((-4 . "<NOT") (0 . "VIEWPORT") (-4 . "NOT>")))) (setq n (getstring t "\nSpecify Block Name <Anonymous>: ")) (setq p (getpoint "\nSpecify Base Point: ")) (obj2blk s n p) (princ) ) (defun c:otbs ( / s n p) (setq s (ssget "_:L" '((-4 . "<NOT") (0 . "ATTDEF,VIEWPORT") (-4 . "NOT>")))) ;;(setq s (ssget "_:L" '((-4 . "<NOT") (0 . "VIEWPORT") (-4 . "NOT>")))) ;;; (setq n (cdr (assoc 1 (entget (car (entsel "\nSelect a text object that holds the name of the block: ")))))) (setq p (getpoint "\nSpecify Base Point: ")) (obj2blk s n p) (princ) )
  3. Today
  4. Thanks in advance for your insights!
  5. Hi everyone, I’m curious about how automation is shaping the manufacturing industry. Recently, I’ve read a lot about the efficiency gains and cost reductions companies achieve, but I’m wondering about practical implementation challenges. Specifically, how do smaller manufacturers integrate advanced machinery without huge upfront investments? I’ve seen a variety of systems, from collaborative robots to fully automated assembly lines. For those with experience, what are the key considerations when selecting robots for manufacturing? Are there common pitfalls to avoid, or best practices to ensure smooth operation?
  6. Vica

    Hybrid parallel

    It's a very interesting topic that has gone unresolved for far too long. At least I never found one. But that solution should also consider any piece of land in the middle of the water. In my opinion, the criterion for defining a centerline depends on the physical property that needs to be preserved. For a river, the property that seems most convenient to preserve is equidistance. However, in a wall, the properties to preserve are angular symmetry and structural direction. Therefore, I agree with GP_ and Dexus. But perhaps for this reason, the tools mentioned in this thread won't be able to correctly calculate the centerline of a wall.
  7. Yesterday
  8. SLW210

    select text as block name

    You would probably need a LISP. Maybe this one... I have moved your thread to the AutoLISP, Visual LISP & DCL Forum.
  9. Please stop posting your off-topic questions in this forum. That is what the Chat forum is here for. Thank you.
  10. thanks in advance for any help
  11. Hi everyone, I’m planning to improve my skills and would love advice from experienced creators. I currently shoot short clips for social media using a mirrorless camera and basic lighting. My biggest challenges are consistent audio, efficient workflows, and storytelling that keeps viewers engaged. In the middle of learning video production, I’m unsure which upgrades matter most right now. Should I prioritize better microphones, editing software, color grading practice, or scripting techniques? I also wonder how professionals balance speed with quality when deadlines are tight. What beginner mistakes should I avoid, and which resources actually helped you grow faster overall?
  12. I’m working on part nesting in AutoCAD and I need to save each part as a block named after the part. Is there a way to create a block and automatically use a selected text object as the block name, instead of typing the name manually?
  13. Use the BATTMAN command to edit the MText color. After changing the color, click Sync and Apply. Only then will the updated MText color be applied to all instances of the block throughout the entire drawing.
  14. Last week
  15. What you'll probably need to do is set the proper coordinate system in your viewport. To make things simpler, you can create the proper view with UCS, give it a name, and save it. That way you can use it as many times as you need to. To prepare your plan, go to paper space, open the viewport, and "restore" the view. Once you have your linework at the right scale, angle, and location, lock the viewport. If your model is not supposed to look like a wireframe, check the properties for the Visual Style while in model space. If this doesn't help, please give us more information.
  16. CivilTechSource

    Viewport Inset Generator

    Hi @troggarf, Lee Mac's VPOutline is a great start! I am having difficulty understanding your lisp. ssget "_:L" will prompt the user to select items using window selection? Could we pass a filter to only select the latest created VPOutlines and just select the Key Plan Viewport? My aspiration is to combine Lee Mac VPOutline with your suggestion. But some further tweaking might be required.
  17. Lee Mac

    A wrapper for ssget function

    No - the messages printed by the (ssget) function ignore NOMUTT; there are likely many other commands/functions which ignore NOMUTT - it depends on how they were implemented and whether NOMUTT/CMDECHO was considered when outputting messages.
  18. Why is this topic posted under the heading "AutoDesk Software General"? It should be in the Chat forum, shouldn't it?
  19. Lee Mac

    A wrapper for ssget function

    No - as you cannot intercept the evaluation of the (ssget) function.
  20. I've been down this rabbit hole before. Relying on Windows Explorer is so hit-or-miss since AutoCAD started compressing the files—it usually only works if you're strictly using TrueType fonts. If you don't want to mess with LISPs or expensive software, sometimes the easiest workaround is to just extract the data/images to a more searchable format. I found a site called https://wordimageextractor.com/ recently when I needed to pull assets out of a project doc to cross-reference things—it’s actually a pretty smooth way to handle those 'how do I find what's inside this file' moments without having to open everything one by one. For the DWGs specifically, though, Lee Mac’s BFIND is definitely the gold standard if you're comfortable loading a LISP routine!
  21. tombu

    cui panel image

    If you're going to share it having all the PNG files converted to transparent then add them to a custom DLL file. I'd recommend copying Acad.dll to the same name as your custom CUI file with the DLL extension instead as that's where the CUI file will look first for the icon. That way you can add all your PNG files into it for you new commands and still reference AutoCAD commands in your custom CUI file as well. Much easier to share a single DLL file than a folder full of PNG files. Changes to Using Resource DLLs with CUIx Files https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-7103E61A-8317-4834-BB00-0FE23AEB020F If you're going to share any customization files it's best to make sure all those files are in both the proper Support and Trusted paths. That way all users can access them, and you never have to include paths to them in any of your customization files. That way if you had it installed both in your office and at home where your (Support and Trusted) file folders would have different paths everything would still work the same. Lots of free online tools for converting images to PNG files with transparent backgrounds like: https://www1.lunapic.com/editor/?action=transparent
  22. You're going to need a different layout for that. Most important thing to learn is creating layouts with templates you can import into other drawings. Once you have them you'll be able to drawings much faster since you shouldn't ever need to do it again. The link to AutoCAD Foundations in AutoCAD Help below is the best place to start. Organize and Output a Design with Layouts (AutoCAD Foundations) https://help.autodesk.com/view/ACD/2026/ENU/?guid=ACD_FOUNDATIONS_MAIN12 AutoCAD provides the best help of any software I know of but as it's hundreds of commands, settings and features that are added to every year you need to dedicate time every day to go through all the help and tutorials you can. Most of us that have spent decades using AutoCAD and it's verticals still don't claim to know it entirely, it's a journey that keeps gets more comfortable as you go along.
  23. thanks in advance for any help
  24. Hi everyone, I’m exploring ways to grow our church community and improve engagement both online and offline. We’ve tried basic social media posts and flyers, but results have been limited. I’m curious if anyone has experience working with a church marketing agency and what specific strategies they used that were effective. How do these agencies help with outreach, event promotion, or increasing attendance? Are there particular tools or campaigns that worked well for your church? Any insights, recommendations, or lessons learned would be greatly appreciated!
  25. NirantarVidyarthee

    A wrapper for ssget function

    Thank you Lee Mac for prompt response. Any thoughts about 3?
  26. thanks in advance for any help
  27. Hey everyone! I’m diving into the Best Friends Planet series and I’m a bit confused about the ideal viewing order. There are so many episodes, specials, and spin-offs, and I want to experience the story in the way that makes the most sense. Should I watch them by release date, chronological storyline, or is there a recommended fan order that enhances the plot and character development? I’d love to hear your thoughts, tips, or any guides you’ve used. Sharing your personal experiences would be super helpful too!
  28. Lee Mac

    A wrapper for ssget function

    (vl-catch-all-apply) is used to catch the error when the user presses Esc during the selection prompt, ensuring NOMUTT is set back to 0.
  29. NirantarVidyarthee

    A wrapper for ssget function

    I am aware that I am reviving a decade old post. But I found it helpful in understanding the wrapper function. As an example of good programming technique I am studying and exploring this function in more details. As a result, I have some doubts that I need to be cleared as part of my learning process: 1. What is the purpose of using (vl-catch-all-apply) function? I believe there are no errors that cause the (ssget) function to abort. So what error is this function handling? I am not very experienced user, so I may be missing some situations. 2. If I use (apply) instead of (vl-catch-all-apply) and comment the statement (vl-catch-all-error-p), I do not see any difference in the output. Am I missing something? Here is the modified function. (defun M:LM:ssget ( msg params / sel ) (princ msg) (setvar 'nomutt 1) (setq sel (apply 'ssget params)) ; (vl-catch-all-apply) replaced with (apply) (setvar 'nomutt 0) ;;; - Commented (if (not (vl-catch-all-error-p sel)) sel) sel ; Added to ensure return value ) 3. there is one minor problem. When using (ssget) if you start window selection and press enter without clicking second corner point an error message is displayed and select object prompt is repeated. In this function, the error message is displayed but prompt is not repeated causing confusion if the command has ended although selection cursor is displayed to know that the selection is continuing. Is there a way to re-display the msg AFTER the error message to avoid confusion? 4. A related question: I believe problem 3 is because the function (vl-catch-all-error-p) ignores NOMUTT. What are other commands / functions that are not affected by NOMUTT?
  1. Load more activity
×
×
  • Create New...