Offset with Inclined 45 degree Arrow

Offset with Inclined 45 degree Arrow

Anonymous
Not applicable
3,450 Views
9 Replies
Message 1 of 10

Offset with Inclined 45 degree Arrow

Anonymous
Not applicable

how to offset the line or polyline with inclined 45degree arrow. see below image.
offset with arrow.JPG

0 Likes
Accepted solutions (1)
3,451 Views
9 Replies
Replies (9)
Message 2 of 10

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I see that you are visiting as a new member to the AutoCAD forum. Welcome to the Autodesk Community!

 

 Can you please add to your image, the desired outcome of the offset so I can more clearly understand what you are trying to create?


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 3 of 10

Kent1Cooper
Consultant
Consultant

I can imagine a way to do that, and presumably automatable -- Offset, use a Lengthen command with the Delta option and the negative of the Offset distance to shorten the ends of the result of Offsetting, and then put in arrows from the start of the original to the start of the new, and similarly between the ends of each.  What should the arrows be?  Leaders?  Blocks?  Blocks with separate Lines as tails?  Polylines with variable width to make the arrowheads?  Something else?  Is there a constant relationship between Offset distance and arrowhead length, such as the arrowhead should always be half the length of the diagonal, or should the arrowhead size be constant with the tail length varying?

Kent Cooper, AIA
0 Likes
Message 4 of 10

Anonymous
Not applicable

Hi John,

 

thanks for welcoming.

 

offset with arrow.JPG

0 Likes
Message 5 of 10

Anonymous
Not applicable

Hi Kent1Cooper,

 

sorry  i'm new here, 

 

the arrow should be like leaders adjustable/resizeable  and the arrow degree also can be 45degree or 30 degree ( adjustable ). the offset distance is variable it can be 100mm or 150mm. 

 

0 Likes
Message 6 of 10

Anonymous
Not applicable

it's like an offset command or dimension linear command.Capture.JPG

0 Likes
Message 7 of 10

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:

.... Offset, use a Lengthen command with the Delta option and the negative of the Offset distance to shorten the ends of the result of Offsetting, and then put in arrows from the start of the original to the start of the new, and similarly between the ends of each.  What should the arrows be?  Leaders?  ....


 

This is the idea described above, assuming Leaders as the answer to that question.  In simplest terms, lightly tested:

(defun C:OAL (/ ent1 ent2); = Offset with Angled Leaders
  (command
    "_.offset" pause (setq ent1 (car (entsel))) pause ""
    "_.lengthen" "_delta" (- (getvar 'offsetdist))
      (vlax-curve-getStartPoint (setq ent2 (entlast)))
      (vlax-curve-getEndPoint ent2)
      ""
    "_.chprop" ent2 "" "_layer" (getvar 'clayer) ""
    "_.leader"
      (vlax-curve-getStartPoint ent1)
      (vlax-curve-getStartPoint ent2) "" "" "_none"
    "_.leader"
      (vlax-curve-getEndPoint ent1)
      (vlax-curve-getEndPoint ent2) "" "" "_none"
  ); command
  (princ)
); defun

It even works on Arcs, or Polylines with arc segments at their ends, or Splines, though the angle of the Leader will be slightly off, varying with the tightness of the curve.

OAL.PNG

BUT NOTE several things:

 

It's based on your original image.  It requires a single object, so it won't do the inboard part of the left side of your image in Message 6 [I'm having a hard time imagining how to do that in a way that a routine could figure out], and in the right side, it would require the two inside edges of each L, and only those two edges, to be joined together into a Polyline.

 

It assumes the Erase option in Offset is set to No -- that could be built into it just in case.

 

It only shortens  the ends of the Offset result.  Presumably it might be made to check the length of the selected object and/or of the result from Offsetting, and if it's too short to shorten both ends by the Offset distance, make them longer instead, like the top-end parts of the left half of your image in Message 6.

 

It requires the current Dimension Style's arrowhead for Leaders to be a suitable type [presumably some kind of arrow but not the Right-angle variety, rather than, for example, a tick or datum triangle or ...], and appropriately sized  for the Offset distance.  Presumably it could be made to either set the Offset distance itself based on the current arrow size, rather than ask the User, or alter the arrow size based on the User's specified Offset distance.

 

The angled Leaders at the ends are separate from  the Offset object connecting them [which is, of course, a Line or Polyline or Arc or Spline or...].  One advantage of having it make a Polyline  with width variations making the arrowheads, rather than using Leaders, would be that the whole thing would be one object, but that would limit the object types it could work on [no Splines, for instance].

 

It could be made to offer a choice of angles, but when you say you want a 30-degree option, which 30 degrees do you mean?

OAL30.PNG

Kent Cooper, AIA
0 Likes
Message 8 of 10

Anonymous
Not applicable

left side of your image. it is possible to have an option to enter the degree of arrow?


Capture.JPG

0 Likes
Message 9 of 10

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

left side of your image. it is possible to have an option to enter the degree of arrow?


 

Certainly.  Try this [lightly tested]:

(defun C:OAL (/ ent1 ent2); = Offset with Angled Leaders
  (setq *OALang ; global variable [in radians]
    (cond
      ( (getangle
          (strcat
            "\nAngle of end Leaders off path object <"
            (angtos (cond (*OALang) ((/ pi 4))))
              ; prior value default if present, otherwise 45, in
              ; current angular-units mode/precision settings
            ">: "
          ); strcat
        ); getangle
      ); User-input [other than Enter] condition
      (*OALang); keep prior value if present on Enter
      ((/ pi 4)); Enter on first use [45-degree default]
    ); cond
  ); setq
  (command
    "_.offset" pause (setq ent1 (car (entsel))) pause ""
    "_.lengthen"
      "_delta" (- (* (getvar 'offsetdist) (/ (cos *OALang) (sin *OALang))))
      (vlax-curve-getStartPoint (setq ent2 (entlast)))
      (vlax-curve-getEndPoint ent2)
      ""
    "_.chprop" ent2 "" "_layer" (getvar 'clayer) ""
    "_.leader"
      "_none" (vlax-curve-getStartPoint ent1)
      "_none" (vlax-curve-getStartPoint ent2) "" "" "_none"
    "_.leader"
      "_none" (vlax-curve-getEndPoint ent1)
      "_none" (vlax-curve-getEndPoint ent2) "" "" "_none"
  ); command
  (princ)
); defun

It remembers your angle choice, and offers it as default on subsequent use.  It even accepts angles greater than 90 degrees -- here's the result giving it 120:

 

OAL120.PNG

[but that's by User specification of more than 90 -- it doesn't calculate whether to go outboard, as I described as a possibility before].

 

Not-yet-included enhancements are possible:

Undo begin-end wrapping [so if you undo, it dumps the two Leaders and the Offset object all together];

Error handling [not really necessary except along with the above];

Automatic repeat to do it to more than one thing in the same command;

Handle offset distance setting differently [not just a single pause] to allow picking two points on-screen;

Layer control.

Kent Cooper, AIA
0 Likes
Message 10 of 10

Anonymous
Not applicable

Hi  Kent1Cooper,

 

 

0 Likes