Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/05/2021 in all areas

  1. Here's a quick one: (defun c:foo nil ;; RJP » 2021-08-05 (vlax-for b (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (if (= 0 (vlax-get b 'islayout) (vlax-get b 'isxref)) (vlax-put b 'explodable -1) ) ) (princ) )
    2 points
  2. As far as I know, you can't apply a separate visual style to an xref. I would put all the hatches in the xref on the same layer and freeze that layer in the working drawing.
    2 points
  3. If you want a drop down menu make a custom .mnu its just a text file using Notepad, going custom is much easier than using the CUI, a POP menu can have sub menu's as well. Making a custom mnu can be edited at any time and its a simple menuload to update, we had the mnu on the server so when a user opened Autocad they always got the latest version. You can make custom tool bars as well with custom icons again using notepad. More than happy to provide examples. The other is if you want a pop DCL select use my Multi radio buttons.lsp that was written for this type of situation. Multi radio buttons.lsp
    2 points
  4. @mhupp FWIW when using "_X" with ssget you don't need vl-remove and you need to check that the selection is valid: (if (setq a3 (ssget "_X" '((2 . "SW_CEN*")))) (foreach e (mapcar 'cadr (ssnamex a3)) (entdel e)) )
    1 point
  5. Done. Working on it. Then it will cause a loop and I'll have to fix that. Yes, probably. But, unfortunately, it's not how I want to go about it. By going the reactor route, I will end up with a more powerful program. I do truly appreciate all the help and suggestions that everyone has given me on this project. I am not looking for the easy way to solve this. I want to learn and grow as a programmer. Pushing the limits, even if I crash AutoCAD, is the only way to do that. I am interested in using reactors within my program because I think they will solve my problem in the best manner.
    1 point
  6. Just another way of doing it without the i variable. (if (setq A3 (ssget "_X" '((2 . "SW_CEN*")))) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex A3))) (entdel e) ) ) set up a function like this.
    1 point
  7. Google is your friend, I like google.... 1st result: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-make-unexplodable-blocks-explodable/td-p/2107647 2nd page and a LISP by RonJon (just stealing his thunder, no doubt he will be along later with the same link)
    1 point
  8. Just as a workout for me, you can use recursive mode to find double vertices. The remove_doubles function is not mine. (defun c:elptlw (/ remove_doubles ent) (defun remove_doubles (lst) (if lst (cons (car lst) (remove_doubles (vl-remove (car lst) lst)))) );;; not mine (setq ent (car(entsel"\nSelecciona lwpolyline: "))) (vlax-put (vlax-ename->vla-object ent) 'coordinates (apply 'append (reverse (remove_doubles (mapcar 'cdr (vl-remove-if-not '(lambda (elem) (= (car elem) 10)) (entget ent))))) ) ) (princ) )
    1 point
  9. It's not clear to me what you want to do. The simplest solution to delete a selection set is the one given by confutatis. On the other hand, you want to learn VLA(?). A start could be the snippet below. (ssget "_X" YOUR_FILTER_HERE) (setq SEL (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))) (if (> (vla-get-count SEL) 0) (vlax-for Obj SEL DO WHAT YOU WANT WITH Obj HERE ) ) (setq SEL nil)
    1 point
  10. From my experience using reactors, I for one hate using vlr-modified. There's just way too many factors to take into account to ensure a code that's working properly. Given time and effort, sure it works: 1. Ensuring the outline is editable in an unlocked and thawed layer 2. Undoing and redoing (vlr-modified triggers on undo and redo) which may lead to your codes malfunctioning (because you can't modify objects whilst undoing or redoing). 3. If used wrong, may cause in an infinite vlr-modified loop between "master" and "slave" objects. With every passing error that is invoked, I believe AutoCAD become more fragile. If used frequently, may even cause CAD to crash unexpectedly. It happens a lot for me and I've learned a painful lesson to never use it again unless I'm very experienced. I'd probably recommend just using parametric constraints because they're also basically reactors too like automatic dimensions. I basically only use reactors for very simple purposes, like automatically saving the current file upon running some specific AutoCAD commands or LISP routines.
    1 point
  11. ...although there is still the problem of bulges, but congratulations to ronjonp for being able to synthesize a not easy code
    1 point
  12. Jonathan Very nice simple solution. Briscad ?? : AUTOCONSTRAIN This feature is currently only available for beta users. May need V21
    1 point
  13. HAHAHA ... cross posted at Adesk forum last Friday.
    1 point
×
×
  • Create New...