DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Custom lines, and reversing order of points

Started by adriank, October 01, 2017, 07:55:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Adrian 2.0

I've just made a custom line that consists of a series of arrows - I'm using it to indicate flow direction for gutters on a site plan.
If I draw a line right-to-left the arrows point right-to-left as expected, if left-to-right it also displays left-to-right. Reversing the order of points changes the arrow direction... all good so far!
If I draw an arc or circle (or offset one) the arrows always point clockwise, and reversing the order does not change the arrow direction. I'm having to convert the arcs to lines to get the arrows to point in the direction I want - which is time consuming and inflates the size of the drawing.
Is this a bug that is fix-able or am I expecting too much?

Reversing the order of points is a command I use quite a bit - especially when I'm working in 3D mode - if planes do not render properly or when I get unexpected results extruding along a curve (the result is unexpected more often than not, and I never know if I need to reverse the points on the extruded object or extruding path line - 3 or 4 attempts usually gets the result I need)
'Extrude along a curve' is a mis-named command, by the way. It extrudes along a line or arc just as well

Is there any way I can assign a key-stroke to reverse the order of points? I can't find it in the custom keyboard command list. It would be much faster than double clicking to bring up the info box and then moving the mouse to the button at the top.


bdeck

#1
Hi Adrian,

To change point order without using the infobox, run this macro from the command line, or assign it to a hotkey:

'rp.d3m  --- Change point order of an entity
>ReversePoints
{
}


1)  For arcs, if you set the "draw as line" parameter when drawing the arc, and then run the macro, the arrows will reverse (as you note).

2) May be cleaner to just create a second custom line style definition, with your arrowhead (presumably a letter V?) rotated 180 degrees and offset.

3) Alternatively, you could trace a curve over an arc (using the k key), then delete the arc.

4)  As an alternative method to reverse point direction without using a macro, you could add the following to the end of your custom.ini file, so that the "ReversePoints" command could be run from the command line by typing "rp".

        rp=ID_SELECT_POINT_REVERSE

5)  As an alternative method to save a keyboard shortcut to the ReversePoints command, without using a macro, you could do this:
   a) From MacroCmd.ini and Dc3MaxCmd.ini find the command code for the ReversePoints command
   b) In options/options/keyboard, Save a copy of your current keyboard shortcut file as asci file "k000.dka"
   c) In options/options/keyboard,  Assign a new keyboard shortcut to any random command (without a shortcut).
   d) Save a copy of your modified keyboard file as  "k001.dka"
   e) Using a compare file utility, compare k000.dka to k001.dka to find the line that changed.
   f)  In a text editor edit the final term of the changed line to the code for the desired command.
   g) Save the edited file as "k003.dka"
   h) In options/options/keyboard, load asci file "k003.dka"
   i) If you are happy with it, then options/options/keyboard/Save As Default.
     
For example, if your shortcut is Shft+R, then the new line in the asci file would be :

       7,82,9763

The macro is easier.
bd

Adrian 2.0

Thanks BD, the macro works perfectly.
Now I just need to remember  - firstly that I have assigned a key for that and secondly, which key?

Adrian

Bob P

BDeck,

Where did you come up with the reversepoints command? I couldn't find it anywhere in the DC system files, but I suspect I missed one.

Lar


Quote from: adriank on October 01, 2017, 07:55:37 AM
If I draw an arc or circle (or offset one) the arrows always point clockwise,
It's curious that the arrows always point clockwise since arcs/circles are always created pointing counter-clockwise (which you can see by the rubber band preview always going c/cw, even if you move the cursor cw).


Lar

bdeck

#5
Quote from: Bob P on October 02, 2017, 04:49:03 AM
Where did you come up with the reversepoints command? I couldn't find it anywhere in the DC system files, but I suspect I missed one.

Hi BobP,

Found the "reversepoints" command in Macros17.hlp by searching the word "order".

Then in a file text search for "reversepoints" using TotalCommander, found the entry in MacroCmd.ini.

Then in a file text search for "reverse" using TC, found the entry in Dc3MaxCmd.ini.

Been using TC for maybe 20 years now. Probably learned about it from you. Used it for the file compare as well.

Thanks,
bd

Quote from: adriank on October 01, 2017, 07:55:37 AM
Is this a bug that is fix-able or am I expecting too much?
Adrian,  presuming you meant to say "counterclockwise",  I still agree with Lar that it is "curious."  and the curiosity should be fixable. A negative arc angle should result in a clockwise custom line.

Further still, a custom arrows linestyle is such a commonly needed tool that it should ship with DC. Users should not have to create their own arrows, broken or otherwise.

Bob P

BDeck,

Thanks. My mistake was assuming it was natively treated as a command. There were some references to similar numbered commands in the ini file, but I guess they wanted to keep the actual (macro-compatible) command secret.  >:(

Adrian 2.0

Guys,
I don't think it's that curious that my arrows ae pointing the wrong way, given that I rotated a V to get the arrow I must have rotated it the wrong way in the first place!
I agree that it would be better if DCad has an in-built allow linestyle, and maybe the programmers can actually get it pointing the right way!

As for 'anti-clockwise', it all depends on where you are born! We also have bonnets on our cars and put our luggage in the boot...

Adrian

bdeck

#8
Quote from: bdeck on October 01, 2017, 11:15:06 AM2) May be cleaner to just create a second custom line style definition, with your arrowhead (presumably a letter V?) rotated 180 degrees and offset.

Or maybe not.

Adrian,   

Apparently you rotated your "V" to 270 degrees. And apparently for good reason.

It appears that if you rotate the "V" by 90 degrees, it must be offset in the x direction to match up with the right end of a dash.
(Edit:  I now see that the arrowhead shape's x offset is necessary only when adding the shape to a dash having a non-zero dash offset.)

The offset shape looks Ok when drawing straight lines, but when the custom line style is bent around an arc or a curve, the shape goes off on a tangent according to its x offset and the radius of curvature. Giving the dash a negative length or offset did not seem to help.  Anyone got a solution for this?   

bd

Takeaway: Never use X offset unless you really mean it.

PS:  After re reading the reference manual I found what I was doing wrong. Hint: "Offset" does not necessarily mean "Offset". See example in post below.

Rob S

Have you tried using the "Caret" - ^ symbol (shift 6) for your line - which is basically an upside down V ?

Note - I have not ever made a custom line, so not sure if it would work - just an idea....
User since forever

bdeck

#10
Quote from: bdeck on October 03, 2017, 07:23:52 AM
Anyone got a solution for this? 

Oops. Attached picture shows example settings for left to right arrows that work without an X offset for the "V" shape. 
Triangle shape works  too, with no X or Y offset.

RobS,

The custom linestyle editor has 3 shapes that can be used for an arrowhead:  the letter "v", the triangle, and the first zigzag (a caret).  As it turns out the zigzag requires a little extra work to connect it to a centerline, but they all seem to work fine.

Regards,
bd