Jump to content

Recommended Posts

Posted

Hey guys it's me again.

 

I'm using an auto lisp for labeling X and Y coordinates which I'm pretty happy with (thanks to you guys)

 

I've just some minor adjustments I want adding.

 

autolisp.jpg

 

The above coordinates are taken by the lisp program itself.

The coordinates below is how I want the lisp to look like. I've basically drawn a line and then an arrow pointing at the point as well as re-sizing the text to suit.

 

(defun c:dimo ( / p )
(while (setq p (getpoint "\nSpecify Point <Exit>: "))
(command "_.dimordinate" "_non" p "_T" (strcat "X=" (rtos (car p) 2 0) "Y=" (rtos (cadr p) 2 0)))
)
(princ)
)

 

And that's the code I'm using.

 

Thanks

Posted

Just change the height of the Text style which is in current Dim style to suit your needs . ;)

Posted

What about the 'arrow and line' so it looks neater?

 

Edit: Changed the height of the text thanks.

Posted

From the same dialog for the dimension styles .

 

Type at the command line: dimstyle and look into the tab ( Symbols and Arrows )

Posted

I changed the arrow heads, it doesn't make a different. Is it as simple as changing the dimension styles or because it's an auto lisp do I have to put that into the program itself?

Posted

The dimordinates command does not have arrow heads, so you will not see any difference of course ;)

 

You may need to use Qleader or Mleader to manipulate with Arrow heads ' sizes .

Posted

I'm sorry I don't know that command, tried playing about with it but to no avail

Posted

Here is an example for you to consider:

 

[color=GREEN];; Creates an MLeader object with two vertices displaying the coordinates[/color]
[color=GREEN];; of the first selected point expressed relative to the current UCS, in[/color]
[color=GREEN];; decimal format rounded to the nearest integer.[/color]
[color=GREEN];; By Lee Mac 2012[/color]

([color=BLUE]defun[/color] c:pt ( [color=BLUE]/[/color] ml p1 p2 sp )
   ([color=BLUE]setq[/color] sp
       ([color=BLUE]vlax-get-property[/color] ([color=BLUE]vla-get-activedocument[/color] ([color=BLUE]vlax-get-acad-object[/color]))
           ([color=BLUE]if[/color] ([color=BLUE]=[/color] 1 ([color=BLUE]getvar[/color] 'cvport)) 'paperspace 'modelspace)
       )
   )
   ([color=BLUE]while[/color]
       ([color=BLUE]and[/color]
           ([color=BLUE]setq[/color] p1 ([color=BLUE]getpoint[/color] [color=MAROON]"\nPick Point: "[/color]))
           ([color=BLUE]setq[/color] p2 ([color=BLUE]getpoint[/color] [color=MAROON]"\nPick Endpoint of Leader: "[/color] p1))
       )
       ([color=BLUE]vla-put-textstring[/color]
           ([color=BLUE]setq[/color] ml ([color=BLUE]vlax-invoke[/color] sp 'addmleader ([color=BLUE]append[/color] ([color=BLUE]trans[/color] p1 1 0) ([color=BLUE]trans[/color] p2 1 0)) 0))
           ([color=BLUE]strcat[/color] [color=MAROON]"X="[/color] ([color=BLUE]rtos[/color] ([color=BLUE]car[/color] p1) 2 0) [color=MAROON]" Y="[/color] ([color=BLUE]rtos[/color] ([color=BLUE]cadr[/color] p1) 2 0))
       )
       ([color=BLUE]if[/color] ([color=BLUE]<=[/color] ([color=BLUE]car[/color] p2) ([color=BLUE]car[/color] p1))
           ([color=BLUE]progn[/color]
               ([color=BLUE]vla-setdoglegdirection[/color] ml 0 ([color=BLUE]vlax-3D-point[/color] '(-1.0 0.0 0.0)))
               ([color=BLUE]vla-put-textjustify[/color] ml [color=BLUE]acattachmentpointmiddleright[/color])
               ([color=BLUE]vlax-invoke[/color] ml 'setleaderlinevertices 0 ([color=BLUE]append[/color] ([color=BLUE]trans[/color] p1 1 0) ([color=BLUE]trans[/color] p2 1 0)))
           )
       )
   )
   ([color=BLUE]princ[/color])
)
([color=BLUE]vl-load-com[/color]) ([color=BLUE]princ[/color])

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...