Jump to content

Leaderboard

Popular Content

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

  1. Probably need to use layer states. https://www.theswamp.org/index.php?PHPSESSID=liu951ho7q5s5nab8ntohghhv5&topic=44690.msg499120#msg499120 --edit-- LOL I should really finish reading before posting.
    2 points
  2. This more complicated version will also temporarily toggle Osnaps on while Zooming if needed for newer versions. ; Zoom Window using Osnap settings by Tom Beauford ; Macro: ^P(or C:ZSnap (load "ZSnap.lsp"));ZSnap ; Command line: (load "ZSnap.lsp") ZSnap (defun c:ZSnap ( / *error* osmode pt1 pt2) (defun *Error* (msg) ; embedded defun (setvar 'osmode osmode) (if (/= s "Function cancelled") (princ (strcat "\nError: " msg)) ) (princ) ) (setq osmode (getvar 'osmode)) (if (> (getvar 'osmode) 16384) (setvar 'osmode (- osmode 16384)) ) (setq pt1 (getpoint "\nSelect First Window Point: ")) (setq pt2 (getcorner pt1 "\nSelect Second Window Point: ")) (command "._zoom" "_w" pt1 pt2) ; end zoom (setvar 'osmode osmode) ) Osnap bitcodes changed when Geometric CEnter osnap was added so you will need to find the old bitcode setting to Suppress the current running object snaps in older versions.
    1 point
  3. Try: (defun c:ZSnapOld ( / pt1 pt2) (setq pt1 (getpoint "\nSelect First Window Point: ")) (setq pt2 (getcorner pt1 "\nSelect Second Window Point: ")) (command "._zoom" "_w" pt1 pt2) ; end zoom ) It should snap to whatever osnap settings you're alteady using. Sometimes simple is best.
    1 point
  4. Just like @BIGAL and @tombu said, ssget isn't compatible with prompting messages like entsel does. Probably in the future it might change.
    1 point
  5. Expanding on what BIGAL said From AutoCAD Help initget (AutoLISP) https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-9ED8841B-5C1D-4B3F-9F3B-84A4408A6BBF lists all the lisp functions it works with. No selection set functions are included. ssget (AutoLISP) https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3 describes using ssget with a filter list and About Selection Set Filter Lists (AutoLISP) https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-7BE77062-C359-4D01-915B-69CF672C653B gives a few examples and provides related topics and links to help you make whatever filter you need.
    1 point
  6. SSget works with filters like objects Circle Arc Line, you have to make a choice before running ssget then you can use your filter. So create a initget with what you want. Then do the ssget with correct filter, can not provide more info as do not know what it is your trying to use.
    1 point
  7. What you posted almost works Variables don't get quotes when you call them. This is what you need. (defun C:3COLORS (/ Color ss) (initget "Red Green Yellow" 1) (setq Color (getkword "\nEnter color for the circles [Red/Green/Yellow]: ")) (if (setq ss (ssget '((0 . "CIRCLE") (-4 . "=") (40 . 4)))) (progn (vl-cmdf "_Chprop" SS "" "C" Color "") (prompt (strcat "\n" (itoa (sslength ss)) " Circles Changed to Color " color)) ; this was also out of order a bit. ) (prompt "\nNo Circles Selected...") ) (princ) ) Cleaned up your code a bit. I don't know what you where trying to do with the two points but you Don't call them again. This code is limited to circles with a radius of 4 so like @BIGAL and others have pointed out maybe use a Variable on that too. (defun C:3COLORS (/ Color radi ss) (initget "Red Green Yellow" 1) (setq Color (getkword "\nEnter color for the circles [Red/Green/Yellow]: ")) (setq radi (getreal "\nRadius [4]:")) (if (= radi nil) (setq radi 4)) (if (setq SS (ssget (list (cons 0 "CIRCLE") (cons -4 "=") (cons 40 radi)))) (progn (setvar 'cmdecho 0) (vl-cmdf "_Chprop" SS "" "C" Color "") (prompt (strcat "\n" (itoa (sslength ss)) " Circles Changed to Color " color)) (setvar 'cmdecho 1) ) (prompt "\nNo Circles Selected...") ) (princ) ) This allows you to enter a Radius if you leave it blank it will set it to 4. --edit changed from (getint to (getreal getint only allows whole numbers.
    1 point
  8. In your case it looks like "MIDDLE RIGHT" justify was how the block was originally set up. Someone then changed the justification to "MIDDLE CENTER" - throwing off all the text placement. If you want to fix it all at once, just select all the text in the block, go into the properties window and change the justification back to "MIDDLE RIGHT" and it will recenter all at one time. If you want to keep the justification "MIDDLE CENTER", like you have it in the drawing, you would just need to use a move command and move all of the MTEXT's over to the left slightly. -ChriS
    1 point
  9. Looks like someone changed the justification for them in the Properties Palette instead of using JUSTIFYTEXT. Change Text Justification Without Moving the Text Position with JUSTIFYTEXT: https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/Change-Text-Justification-Without-Moving-the-Text-Position-with-JUSTIFYTEXT.html
    1 point
  10. It appears that all the texts have been inserted the same distance away from the centre point of the cell. Measure how far that is for one of the texts, and then move all the texts to the left. I reckon the distance is 0.1549 but you can check measure that yourself.
    1 point
×
×
  • Create New...