Jump to content

Recommended Posts

  • Replies 34
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    15

  • alanjt

    6

  • gordon_Gjs

    4

  • woohhoo

    3

Top Posters In This Topic

Posted Images

Posted

Habit I suppose - wanting to be certain, but I suppose it is a bit redundant.

 

Thanks mate. :)

Posted

Lee Mac that works greats and is what I am looking for! Would it be possible to make an adjustment if I am not being too picky? Could the value be centered in the middle of the line instead of floating on top?

 

Do you know if this could be reworked to work in Autocad 2010 LT with an add-on tool-kit?

I tried to run it using the "SlingShot" tool-kit and it comes up...

 

"Select objects:

; error: unable to get ObjectID: "

 

...After I select the object and hit enter.

 

Thanks for this great Lisp! Great Job!

Posted

I'm not sure about the LT Extender, as I have never worked with one, but I can certainly center the Text in the middle of the Polylines/Lines.

 

Would you like a Background mask also?

Posted

Could it be possible to make one with and without mask so I can compair? Sorry if I am a bug! Thanks!

Posted

Try this Gordon,

 

I've added Circles and Arcs also:

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:PlL [b][color=RED]([/color][/b] [b][color=BLUE]/[/color][/b] *error* spc i ss e Der p obj typ [b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [i][color=#990099];; Lee Mac  ~  29.04.10[/color][/i]

 [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] *error* [b][color=RED]([/color][/b] msg [b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]or[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]wcmatch[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcase[/color][/b] msg[b][color=RED])[/color][/b] [b][color=#a52a2a]"*BREAK,*CANCEL*,*EXIT*"[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] [b][color=#a52a2a]"\n** Error: "[/color][/b] msg [b][color=#a52a2a]" **"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]

 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] spc
   [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]or[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [color=Blue][b]AcModelSpace[/b][/color]
         [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveSpace[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc
             [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b]
             [b][color=RED])[/color][/b]
           [b][color=RED])[/color][/b]
         [b][color=RED])[/color][/b]
       [b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=Blue]:vlax-true[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-MSpace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ModelSpace[/color][/b] doc[b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-get-PaperSpace[/color][/b] doc[b][color=RED])[/color][/b]
   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]

 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] i [b][color=#009900]-1[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#a52a2a]"CIRCLE,ARC,LINE,*POLYLINE"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   
   [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] e [b][color=RED]([/color][/b][b][color=BLUE]ssname[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Der
       [b][color=RED]([/color][/b][b][color=BLUE]angle[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#009999]0.[/color][/b] [b][color=#009999]0.[/color][/b] [b][color=#009999]0.[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getFirstDeriv[/color][/b] e
           [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getParamatPoint[/color][/b] e
             [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] p [b][color=RED]([/color][/b]MidPoint e[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           [b][color=RED])[/color][/b]
         [b][color=RED])[/color][/b]
       [b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
               
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Obj
       [b][color=RED]([/color][/b]MCMText spc p [b][color=#009999]0.[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] [b][color=#a52a2a]"%<\\AcObjProp Object(%<\\_ObjId "[/color][/b]
           [b][color=RED]([/color][/b]GetObjectID [b][color=RED]([/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b] e[b][color=RED])[/color][/b] doc[b][color=RED])[/color][/b] [b][color=#a52a2a]">%)."[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]cond[/color][/b]
             [b][color=RED]([/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#a52a2a]"CIRCLE"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] typ [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] e[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
               [b][color=#a52a2a]"Circumference"[/color][/b]
             [b][color=RED])[/color][/b]
             [b][color=RED]([/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#a52a2a]"ARC"[/color][/b] typ[b][color=RED])[/color][/b]
               [b][color=#a52a2a]"ArcLength"[/color][/b]
             [b][color=RED])[/color][/b]
             [b][color=RED]([/color][/b]
               [b][color=#a52a2a]"Length"[/color][/b]
             [b][color=RED])[/color][/b]
            [b][color=RED])[/color][/b]
           [b][color=#a52a2a]" \\f \"[/color][color=#a52a2a]%lu6\[/color][/b][b][color=#a52a2a]">%"[/color][/b]
         [b][color=RED])[/color][/b]
       [b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]

     [b][color=RED]([/color][/b][b][color=BLUE]vla-put-rotation[/color][/b] Obj [b][color=RED]([/color][/b]MakeReadable Der[b][color=RED])[/color][/b][b][color=RED])[/color][/b]

   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] MCMText [b][color=RED]([/color][/b]block point width string [b][color=BLUE]/[/color][/b] o[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vla-put-AttachmentPoint[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] o [b][color=RED]([/color][/b][b][color=BLUE]vla-AddMText[/color][/b] block
             [b][color=RED]([/color][/b][b][color=BLUE]vlax-3D-point[/color][/b] point[b][color=RED])[/color][/b] width string[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=Blue]acAttachmentPointMiddleCenter[/color][color=RED])[/color][/b]
 
 [b][color=RED]([/color][/b][b][color=BLUE]vla-put-InsertionPoint[/color][/b] o [b][color=RED]([/color][/b][b][color=BLUE]vlax-3D-point[/color][/b] point[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 
 o[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] MakeReadable [b][color=RED]([/color][/b] a [b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]cond[/color][/b]
   [b][color=RED]([/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]>[/color][/b] a [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] [b][color=BLUE]pi[/color][/b] [b][color=#009900]2[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]<=[/color][/b] a [b][color=BLUE]pi[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

     [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] a [b][color=BLUE]pi[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]>[/color][/b] a [b][color=BLUE]pi[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]<=[/color][/b] a [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]*[/color][/b] [b][color=#009900]3[/color][/b] [b][color=BLUE]pi[/color][/b][b][color=RED])[/color][/b] [b][color=#009900]2[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

     [b][color=RED]([/color][/b][b][color=BLUE]+[/color][/b] a [b][color=BLUE]pi[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b]
     a
   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] GetObjectID [b][color=RED]([/color][/b] obj doc [b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#a52a2a]"X64"[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]strcase[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]getenv[/color][/b] [b][color=#a52a2a]"PROCESSOR_ARCHITECTURE"[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
   [b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]vlax-invoke-method[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-get-Utility[/color][/b] doc[b][color=RED])[/color][/b] [b][color=DARKRED]'[/color][/b]GetObjectIdString obj [b][color=Blue]:vlax-false[/color][/b]
   [b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-Objectid[/color][/b] obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] MidPoint [b][color=RED]([/color][/b] e [b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getPointatDist[/color][/b] e
   [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getDistatParam[/color][/b] e
       [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getEndParam[/color][/b] e[b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
     [b][color=#009999]2.[/color][/b]
   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

Posted
Habit I suppose - wanting to be certain, but I suppose it is a bit redundant.

 

Thanks mate. :)

No problem. Hope the link helped.

Posted

I just tried it and it works great, how hard would it be to take off background mask?? Thanks!

  • 3 years later...
Posted

Hats off to both Lee and Alan ... lifesavers the both of you. Posted a similar question today requesting similar output ... should have known that you guys would have already encountered it and dealt with it by now.

Thanks again.

  • 8 months later...
Posted

Hi. Prompt how to change lisp removing autonumbering, but leaving the alignment?

  • 1 year later...
Posted

Hi Lee,

 

You may be able to assist me with this:

Making DIMARC.lsp execute globally (or should I say, execute in a loop). Hence labels all arc segments in a drawing.

Please note that preference is arc, not 3 Point Angular Dimension.

Attached lsp files could lead you through.

 

Sincerely with thanks,

Edwin

DIMARC.lsp

MDIM_Multiple Polylines.lsp

Posted

By the way, it is likewise requesting a lisp to convert 3 Point Angular Dimension to Arc globally.

 

Cheers,

Edwin:)

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