Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2019 in all areas

  1. There is always a way to do it mathematically, however it is often easier to let autocad do it for you, it saves you replicating something it already has built in. The construction, processing and deletion of new geometry is not discernable on modern computers. There is only a problem if something errors between creation and deletion that a defined error handler cannot account for.
    2 points
  2. You didn't say whether these were polylines or separate geometric items (lines and arcs). Creating Geometry may slow the lisp, but would you rather do it by hand. In figure 3, if cyan is a polyline, a simple offset by the radius will produce the centre point of the desired arc as the corresponding vertex (pt2) on the offset line, the "knack" is working out whether the offset distance should be positive or negative. When trying to solve these problems, try adding back as much "removed" geometry as you can. There are also loads of sub functions out there to help, just ask.
    1 point
  3. As I do Civil / Survey drawings whose plan views are all twisted in each viewport I wrote this to set selected block insert, text, mtext, & dimtext angles Horizontal. I've modified it for you to use the snap angle if the view isn't twisted. ;| ;| https://forums.augi.com/showthread.php?171018-rotate-text-to-horizontal-in-viewport&p=1332928&viewfull=1#post1332928 http://www.theswamp.org/index.php?topic=55060.msg595136#msg595136 https://www.cadtutor.net/forum/topic/68912-setvar-snapang-using-lisp-with-greater-than-or-equal-condition/?tab=comments#comment-557172 Set block insert, text, mtext, & dimtext angle Horizontal by Tom Beauford (load "TextHoriz.lsp") TextHoriz Macro: ^P(or C:TextHoriz (load "TextHoriz.lsp"));TextHoriz Command line: (load "TextHoriz.lsp") TextHoriz |; (defun c:TextHoriz (/ ss1 num cnt viewtwist snapang etype obj dimr) (setq ss1 (ssget '((0 . "insert,mtext,text,dimension"))) num (sslength ss1) cnt 0 viewtwist (getvar "viewtwist") snapang (- (rem (+ (getvar 'snapang) (/ pi 2.0)) pi) (/ pi 2.0)) ) (if (or (= snapang (* (/ pi 2) -1)) (= snapang (* (/ pi 2) 3)))(setvar 'snapang (/ pi 2))) (if(/= viewtwist 0.0) (repeat num (setq ent (ssname ss1 cnt)etype (cdr(assoc 0 (entget ent)))) (setq obj (vlax-ename->vla-object ent)) (if(= etype "DIMENSION") (progn (setq dimr (- (vla-get-Rotation obj)viewtwist)) (vla-put-TextRotation obj dimr) ) (vla-put-Rotation obj (- viewtwist)) ) (setq cnt (1+ cnt)) ) ; repeat (repeat num (setq ent (ssname ss1 cnt)etype (cdr(assoc 0 (entget ent)))) (setq obj (vlax-ename->vla-object ent)) (if(= etype "DIMENSION") (progn (setq dimr (+ (vla-get-Rotation obj)snapang)) (vla-put-TextRotation obj dimr) ) (vla-put-Rotation obj snapang) ) (setq cnt (1+ cnt)) ) ; repeat ; (princ "\nNo TWist in Viewport.") ) ; if (princ) )
    1 point
  4. (if (= (setvar 'snapang (- (rem (+ (getvar 'snapang) (/ pi 2.0)) pi) (/ pi 2.0)))(* (/ pi 2) -1))(setvar 'snapang (/ pi 2))) Now it works!
    1 point
  5. Your Text is annotative, you need to make it non-annotative or read up on using annotative Text. ANNOALLVISIBLE = 1 will allow the text to be visible in the Layout Tab. Your current text is set for a 1:1 scale so they will not show at any other scale with ANNOALLVISIBLE = 0
    1 point
  6. Version 1.0.0

    1,365 downloads

    This AutoLISP file can be used to flatten a 3D drawing. It does this by setting all Z values in the drawing to zero. Instructions on how to load and run this file in AutoCAD are given in this thread.
    1 point
×
×
  • Create New...