Jump to content

Recommended Posts

Posted

is there already one out there that does the same thing for text?

 

after I finish my design, I go through and clean up all of the room names and room tags, and I find myself rotating them to fit them in sometimes.

 

I love this and I am sure I will use it, thanks Lee Mac, this is very cool.

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    32

  • alanjt

    9

  • TimZilla

    4

  • Crank

    4

Top Posters In This Topic

Posted (edited)

Thanks Tim,

 

There's three more similar here:

 

http://www.cadtutor.net/forum/showthread.php?t=42426

 

http://www.cadtutor.net/forum/showthread.php?t=35234

 

http://www.cadtutor.net/forum/showthread.php?t=37646

 

The above links are no longer valid. The programmes linked to can now be found here: http://www.lee-mac.com/programs.html

Edited by CADTutor
Update links
Posted

Man, you guys are so awesome. I wish I could do stuff like that because I have so many good idea's, just don't know how to make them.

Posted

Have you thought about combining NumInc and align text to curve?

Posted
Have you thought about combining NumInc and align text to curve?

 

It already is, type 'C' when within NumInc :)

Posted

ok, I am actually using this placing my main tags on a certain job right now. The only problem I am having, it only lets you slide it on a fixed point away from the line. So after I place it I move it a little further from my pipe.

 

I wish it let me move it out further from the line, like once I click to place it at that angle, it lets me move it further away from the line, up, down, left and right. My pipe lengths, sizes and height's are right at that spot, I usually put my tag a little bit out more. I could see everybody at my office using this tool.

 

also, the readable option annoys me, how do I skip that and make it default for yes. If I am asking to much just tell me to shut up =) I am so jealous you know how to do this!

Posted
How about something like this Crank?

[...]

You didn't have to write it, but it seemed a logic step to me. Thanks anyway :)

 

But since you've asked I've tested it and there are a few things that (theoretical) could be improved:

  • Erase the original selection
  • Very important: Use a basepoint so it's possible to align the entities exactly on the curve (perhaps you could use the 0 key to use this)
  • Before you exit the lisp you should select the new entities so you can use them with PREVIOUS in the next command

Posted
ok, I am actually using this placing my main tags on a certain job right now. The only problem I am having, it only lets you slide it on a fixed point away from the line. So after I place it I move it a little further from my pipe.

 

I wish it let me move it out further from the line, like once I click to place it at that angle, it lets me move it further away from the line, up, down, left and right. My pipe lengths, sizes and height's are right at that spot, I usually put my tag a little bit out more. I could see everybody at my office using this tool.

 

also, the readable option annoys me, how do I skip that and make it default for yes. If I am asking to much just tell me to shut up =) I am so jealous you know how to do this!

 

You can use the +/- buttons to alter the offset. All the tools are described in the LISP header/forum page/command-line.

 

As for the readability option, it is easy to remove, I shall post a version with it removed.

Posted
You didn't have to write it, but it seemed a logic step to me. Thanks anyway :)

 

But since you've asked I've tested it and there are a few things that (theoretical) could be improved:

  • Erase the original selection
  • Very important: Use a basepoint so it's possible to align the entities exactly on the curve (perhaps you could use the 0 key to use this)
  • Before you exit the lisp you should select the new entities so you can use them with PREVIOUS in the next command

 

I was quite wary about erasing the original selection, which it why it stayed - perhaps I should include a prompt a la the Mirror command? What do you think?

 

As for the basepoint, are you suggesting that the user should choose the basepoint? Currently the basepoint is the center of the selection.

Posted
I was quite wary about erasing the original selection, which it why it stayed - perhaps I should include a prompt a la the Mirror command? What do you think?

The original selection should just be gone (similar to the Autodesk version).

As for the basepoint, are you suggesting that the user should choose the basepoint? Currently the basepoint is the center of the selection.

Yes. For annotatations the center location this isn't a problem, but if you align other entities it is. Autocad is an exact program, so the positioning of lines etc. has to be accurate.

Now that I'm thinking of it, perhaps you should also use osnaps on placement.:unsure:

Posted
Now that I'm thinking of it, perhaps you should also use osnaps on placement.:unsure:

 

With this form of program, OSnaps are a little out of the question, as you've probably seen with many of these types of program, the grRead loop isn't too great in that way.

Posted

GrRead is neat, but it's sacrifice of precision for visuals makes it virtually pointless.

Posted
GrRead is neat, but it's sacrifice of precision for visuals makes it virtually pointless.

 

True, my programs may be useless, but I enjoy writing them :)

Posted
True, my programs may be useless, but I enjoy writing them :)

I'm not saying your programs are useless. Please do not interpret it that way. That's far from what I was implying.

 

However, you are the poster-boy for GrRead. :wink:

Posted

I just like using it because it is a refreshing change from what is normally accomplished using LISP.

Posted
GrRead is neat, but it's sacrifice of precision for visuals makes it virtually pointless.

 

For OSnap we need a bit of help from Arx:

 

DynText.gif

 

;; An example of Text Placement using a grRead substitute,
;; Function by Lee Mac, using DynDraw by Alexander Rivilis

(defun c:test ( / vers step bit v str prev obj doc point )

 (setq vers
   '((18.0 . "2010")
     (17.2 . "2009")
     (17.1 . "2008")
     (17.0 . "2007")
     (16.2 . "2006")
     (16.1 . "2005")
     (16.0 . "2004")
     (15.6 . "2002"))
 )
 
 (setq step 1e-6
       bit (if (eq "X86"
                 (strcase
                   (getenv "PROCESSOR_ARCHITECTURE")
                 )
               )
             "x32" "x64"
            )
 )

 (cond
   (
     (not
       (setq v
         (cdr
           (assoc
             (atof
               (getvar 'ACADVER)
             )
             vers
           )
         )
       )
     )
    (princ "\n** Not Compatible in this Version **")
   )
   (
     (and
       (null dyndraw)
       (not
         (arxload
           (strcat "DynDraw" v
             (if (eq "2010" v) bit "") ".arx"
           )
         )
       )
     )
    (princ "\n** Arx File not Found **")
   )
   (
     (not
       (eq ""
         (setq str
           (getstring t "\nSpecify Text String: ")
         )
       )
     )
   
     (vl-acad-defun 'UpdateTextCallBack)
    
     (setq obj
       (MCMText
         (if
           (or
             (eq AcModelSpace
               (vla-get-ActiveSpace
                 (setq doc
                   (vla-get-ActiveDocument
                     (vlax-get-acad-object)
                   )
                 )
               )
             )
             (eq :vlax-true (vla-get-MSpace doc))
           )
           (vla-get-ModelSpace doc)
           (vla-get-PaperSpace doc)
         )
         (getvar 'VIEWCTR) 0. str
       )
     )
     (setq point
       (dyndraw "UpdateTextCallBack"
         "\nSpecify Point for Text [string] : "
         "String"
         (+ 2 128 2048)
         -1
         nil
       )
     )
     (and (vl-consp point)
       (vla-put-InsertionPoint obj (vlax-3D-point point))
     )    
   )
 )
)

(defun UpdateTextCallBack ( argument / tmp )

 (cond
   (
     (eq 'STR (type argument))

     (if (eq "String" argument)
       (if
         (not
           (eq ""
             (setq tmp
               (getstring t "\nSpecify New String: ")
             )
           )
         )
         (vla-put-TextString obj tmp)
       )
       (princ "\n** Invalid Keyword **")
     )
    (setq argument t)
   )
   (
     (vl-consp argument)

     (or prev (setq prev argument))

     (if (< step (distance prev argument))
       (progn
         (setq prev argument)

         (vla-put-InsertionPoint Obj (vlax-3D-point argument))
         (vla-update obj)
       )
     )
   )
 )
 argument
)


(defun MCMText ( block point width string / o )
 (vla-put-AttachmentPoint
   (setq o
     (vla-AddMText block
       (vlax-3D-point point) width string
     )
   )
   acAttachmentPointMiddleCenter
 )
 (vla-put-InsertionPoint o
   (vlax-3D-point point)
 )  
 o
)

You'll need the right one of these:

 

http://www.maestrogroup.com.ua/support/dyndraw.zip

Posted
For OSnap we need a bit of help from Arx:

 

 

http://www.maestrogroup.com.ua/support/dyndraw.zip

Nice use of Alexander's ARX! :)

I had never seen that until you linked to it the other day (I think @ TheSwamp). I've been eager to try it out. [My wife went out of town to see a friend, so it's just me and my little girl. Haven't had much time for LISP programming and we're having too much fun.]

Posted
I've been eager to try it out.

 

Me too - I've wanted to completely get my head around it first before just diving in, as the errors with Arx are a little more consequential than LISP :geek:

 

But its a great utility - so many possibilities.

 

The only thing that is annoying is that the user has to get the Arx, so its not a stand-along program. And also, the function doesn't react to direct keyboard input, but rather keyword and string input (at my current level of understanding of it), so you I haven't found a way to replicate my offset controls, for example, in the program in this thread.

 

But its a great function.

 

Lee

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...