Custom Line Type - Requested - Sample Format attached

Custom Line Type - Requested - Sample Format attached

Anonymous
Not applicable
1,294 Views
10 Replies
Message 1 of 11

Custom Line Type - Requested - Sample Format attached

Anonymous
Not applicable

Hi Friends,

 

Is there a way to make custom linetypes exactly (shown dimensions) as shown. The option I am working on is make a block and path array on a line.

 

The details are given in the attached AutoCAD file.

 

Really appreciate the help, if anyone can give me an idea how to make the tag in a line type. I tried Make shape and Make linetype commands in express tolls but the ellipse is coming out as weird jogs ( Resolution 128).

 

Regards,

 

VA

0 Likes
Accepted solutions (1)
1,295 Views
10 Replies
Replies (10)
Message 2 of 11

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... I tried Make shape and Make linetype commands in express tolls but the ellipse is coming out as weird jogs ....


That's because Shape definitions need to be made of straight lines, except for the limited curve capability of octant arcs.  I haven't used them in a long time, but I think these shapes [yellow] could be achieved in Shape definitions with actual curvature, if either will serve:

 

tags.PNG

 

[The dashed blue are your Ellipses.]

Kent Cooper, AIA
Message 3 of 11

Anonymous
Not applicable

Hi Kent1Cooper,

 

Thanks a lot for the clarification. Before you working on it let me ask my client whether they want to keep change their suggested shape. I think they did it in microstation. but could not get that line type in AutoCAD.

 

Thanks again Kent.

 

Regards,

 

VA

0 Likes
Message 4 of 11

DannyNL
Advisor
Advisor

I'm not able to help with such a linetype, but I personally hate shapes and shape files. The drawing you create will be dependent on the shape file and this file needs to be included for all times with your drawing to make sure it looks like you have intended. If you forget the shape file while copying it or sending out to a 3rd party and the linetype will not be shown correctly.

 

I personally would not use a linetype with shapes for this, but probably a routine that draws this type of line and uses a block instead of a shape.

 

Just my 2 cents.

Message 5 of 11

Anonymous
Not applicable

Hi DannyNL,

 

It really makes sense and I totally agree with you. The way I am doing is I made a block with just the bubble the text  and the line between the bubble as a block unit and did an array along the already existing line. And adjust the array distance of the object at 20 in this case. and explode the array once it is done. This is the only thing I can think of at this point to make it exactly the way the client wants.

 

I am doing electrical/ power now, but I have to do optic fiber, Gas  and telecom lines as well for 21 sites ( road intersections basically) in this drawing. So any help or idea to automate this process by any one is appreciated.

 

Thanks for all your support and help.

 

Regards,

 

VA

0 Likes
Message 6 of 11

ВeekeeCZ
Consultant
Consultant

Following @DannyNL's  idea... very simple routine may help you... using the MEASURE command.

 

(defun c:PBlinetype ( / ss i)

  (if (setq ss (ssget '((0 . "LINE,ARC,LWPOLYLINE"))))
    (repeat (setq i (sslength ss))
      (command "_.MEASURE" (ssname ss (setq i (1- i))) "_Block" "B-PB" "_Yes" 20)))
  (princ)
)

 

 

Message 7 of 11

Anonymous
Not applicable

Hi BeeKeeCZ,

 

Thanks for making my day brighter with that awesome code. Great help and timesaver to automate my current manual process. I know I am asking for more. Is there a way to:

  1. User input from a drop-down list of all the available Blocks in the drawing
  2. User input to specify the distance between blocks
  3. Automatically rotate the blocks to follow the line of the curve. Ie. Both ends of the block should fall on the selected object/ reference/ guide line ( line, polyline, arc, circle, ellipse etc.)

Now I am seeing this as a possibility for plant material placements in my landscape drawings, where I need to give only the guidelines, and this lisp can do the placements for me automatically along the guides. Usually the plant placement distances are constant.

Any clarifications on this process I can provide if you can help me get it done.

 

Regards,

 

VA

0 Likes
Message 8 of 11

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

...

  1. User input from a drop-down list of all the available Blocks in the drawing // are you sure that's such a good idea? All blocks in the drawing are suitable for this job? (meaning correct insertion point, scale... ) Will not be there too many of those? 
  2. User input to specify the distance between blocks // ok, try modified code
  3. Automatically rotate the blocks to follow the line of the curve. Ie. Both ends of the block should fall on the selected object/ reference/ guide line ( line, polyline, arc, circle, ellipse etc.) // ok, added the simple control whether the length between the last block and the end of the line is less than 3 (you can adjust), then the last block is erased.

 

...
(vl-load-com)

(defun c:PBlinetype ( / ss i enl)

  (if (setq ss (ssget '((0 . "LINE,ARC,LWPOLYLINE,CIRCLE,ELLIPSE"))))
    (progn
      (or *lt-dist*
          (setq *lt-dist* 20.))
      (setq *lt-dist* (cond ((getdist (strcat "\nDistance between blocks <" (rtos *lt-dist* 2 2) ">: ")))
                           (*lt-dist*)))
    (repeat (setq i (sslength ss))
      (setq enl (entlast))
      (command "_.MEASURE" (setq en (ssname ss (setq i (1- i)))) "_Block" "B-PB" "_Yes" *lt-dist*)
      (if (and (< (rem (vlax-curve-getdistatparam en (vlax-curve-getendparam en))) 3)
               (not (equal enl (entlast))))
        (entdel (entlast))))))
  (princ)
)

 

Edit: code updated, bad last entity (block) erased.

0 Likes
Message 9 of 11

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... Both ends of the block should fall on the selected object/ reference/ guide line ( line, polyline, arc, circle, ellipse etc.) ....


That caught my eye....  @ВeekeeCZ apparently interpreted it as meaning that a last one shouldn't overshoot the end, but I'm wondering whether maybe you meant this:

 

LabelPath.PNG

 

If it's a linetype, with a gap sized to fit the Block, then there will also be a slight gap  between curve and Block -- the red dashed arc indicator of the gap is the same length as the straight overall length of the Block, which means it extends outside  it when curved downward like that, at least with a Block of this or a similar shape.

 

Maybe that's all acceptable, but I just wanted to raise the question.  If you really want what's in the middle of the image, it's hard to imagine how to get it in any automated way, because the distance from the middle of the Block/Shape to the curve would have to vary with the local radius of curvature.  And even if it can be automated somehow, it would have to be a custom routine -- none of the approaches mentioned would be able to do it.

Kent Cooper, AIA
0 Likes
Message 10 of 11

CADaSchtroumpf
Advisor
Advisor
Accepted solution

Try this lisp with options for attribut of block, can be Measure or Divide with symbol required.

The block is oriented and mask the support.

Message 11 of 11

Anonymous
Not applicable

Hi CADaStroump,

 

That perfectly served my purpose. That was awesome. I will test this again and let you know, if there are any issues/ concerns.

 

Regards,

 

VA

 

0 Likes