Author Topic: Point Relative Command  (Read 1150 times)

adriank

  • Hero Member
  • *****
  • Posts: 549
Re: Point Relative Command
« Reply #15 on: October 24, 2018, 06:39:27 PM »
The great flexibility of this program is that there are so many different ways to perform functions & I, like Phil only use a small subset of the available commands - one reason I use the point-relative command to find origin I guess. Fewer keyboard assignments.

Regarding origin, I find I need it under several circumstances.

When I export to Sketchup, SKP files always use the file's original origin - not any new origin I may have assigned - and when combining Sketchup files it's important to know where the origin is.

When working on masterplanning projects & marine work I frequently assign origin at Mercator Grid origin so survey references can be easily called up.

When a drawing becomes too far from origin it messes up hatch patterns badly, so I often need to shift the whole drawing back to origin to make it display properly.

As an example of the last one, the two attachments are of the same hatch (Wave, in a 1 x 1 box at scale 5) the first being placed at origin, the second being 10,000 offset from origin.
Assigning a new origin in the drawing won't fix the hatch pattern issue either - you have to move it back to the original drawing origin.
This is one reason I avoid ever assigning a new origin in a file - I don't know of a way to revert to the drawing's original origin if I ever need it (for export normally in my case).
« Last Edit: October 24, 2018, 06:46:55 PM by adriank »

bdeck

  • Hero Member
  • *****
  • Posts: 932
Re: Point Relative Command
« Reply #16 on: October 25, 2018, 01:16:35 AM »
The great flexibility of this program is that there are so many different ways to perform functions & I, like Phil only use a small subset of the available commands -

one reason I use the point-relative command to find origin I guess. Fewer keyboard assignments.

Hi Adrian,

It seems I've been trying to simplify the process by making it needlessly complex.

As it turns out, if DC were to implement something like the simple suggestion made by Rob S, all users would get what they want, even you and Dr PR.

The solution:

Keep the Point Relative command exactly as it is, except:
   1) Add a control to allow user to convert (or unconvert) a currently selected Point Relative option to a default that subsequently overrides the option retained from a prior instance of Point Relative, while allowing user to select a current option that overrides the default within any single instance.
   2) Make all options available when doing point moves in point select mode.
   3) Never slam anyone into any option, especially "Last Cursor Position".

That's the whole plan. Period.      


...... dcad can't always default to 'Last Point' as long as we can start a command by calling up Point Rel before setting the first point   

Hi Lar, Yes it appears that the "Last Point" option is invalid if there are no points in the point buffer when: 
   a) One has not set a point within a command or in preset point mode.
   b) One is doing a point move in point select mode. (the grab point is apparently not held in the point buffer )

   I'm somewhat annoyed that "Last Point" is often invalid, but I am extremely upset at being slammed.   

   I suspect the best way to avoid slamming itself is to prevent execution of the Point Relative command until the user has selected a valid option. But fixing the command so that it recognizes a point select grab point as the "Last Point" will eliminate the biggest cause of slamming.

Best Regards,

BD

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4237
Re: Point Relative Command
« Reply #17 on: October 25, 2018, 11:06:22 AM »
So, if I understand you correctly, *in the specific case of moving points in Point Select Mode*, you'd like the Last Point option to be available, and use the original position of the point being moved. (I'll assume here that you're gravity-snapping to start the move, not just dragging -- if you just click near the point, the logic could get fuzzy).
That seems reasonable enough. But what if you have drag-selected multiple points? Again, I'll assume you're then gravity-snapping to one of them to start the point move, then hitting Point Relative. So, use the last gravity-snap as "last point" in this case? Perhaps both cases?
25 years with DesignCAD

bdeck

  • Hero Member
  • *****
  • Posts: 932
Re: Point Relative Command
« Reply #18 on: October 25, 2018, 02:02:32 PM »
So, if I understand you correctly, *in the specific case of moving points in Point Select Mode*, you'd like the Last Point option to be available, and use the original position of the point being moved.

Hi DT

Yes, the "Last Point"option should recognize the "grab point" of a point selection set whether that set contains one point or multiple points.

(The "Last Point" option works perfectly now for drawing and moving entites, but not for moving points.)

Quote
(I'll assume here that you're gravity-snapping to start the move, not just dragging -- if you just click near the point, the logic could get fuzzy).
You guys are smart enough to figure it out. :)  (but at least gravity would be a start)

Here's an example:
If in your most recent use of Point Relative you used the "Last Point" option,
   and now you select a group of points in point select mode, and
   use gravity to set a drag point,
   and then hit the apostrophe to display the Point Relative dialog,
   you will find the "Last Point" option grayed out, and
   DC will silently, and without notice slam you into the "Last Cursor Position" option.
   
The user may not discover the resulting error until much later, perhaps when a building collapses.

User is ultimately forced to use the "ReferencePoint" option, which may present other problems.

So there are two issues here:
   1) Fix the Point Relative command to allow the "Last Point" option to recognize the "grab point" in point select mode.
   2) Never slam a user into any option. (If the option must be changed by DC, it should be changed to "Reference Point", preferably with conspicuous notice.)

The second issue will "largely" disappear once the first issue is resolved.

Many Thanks.
Best Regards,
bd

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Point Relative Command
« Reply #19 on: October 25, 2018, 03:17:31 PM »
I guess "Last Point" means "Last Point Set" (or "last set point") because picking up a point does not set a point. But like DT says, picking up a point by right clicking (or pressing the period key) could register a different xyz than picking up the same point by a left click (or pressing comma).

 In the case of some dimensions you can't right click to pick up one of the measurement points. You have to left click when the cursor is close enough to the point and it changes into the bullseye.


Lar

Rob S

  • Hero Member
  • *****
  • Posts: 4571
    • Construction Estimating Program for General Contractors
Re: Point Relative Command
« Reply #20 on: October 25, 2018, 07:15:25 PM »
Da Troll has emerged from da cave, I wonder what dat means for da future ...

I wuz beginning to wonder if dere was any future.
User since Pro-design

bdeck

  • Hero Member
  • *****
  • Posts: 932
Re: Point Relative Command
« Reply #21 on: October 25, 2018, 09:11:03 PM »
Here's something that occurred to me while reading the documentation for the SETSELECTEDPOINTS  statement and the GroupPointsMove{} command.

When using the "Last Point" option in the Point Relative command to do a point move in point select mode, it does not matter which point is the "drag handle", or even if there IS a drag handle.

The move is point relative. All selected points will be moved by the same displacement, regardless of where the drag handle is located. The best solution may be to ignore any drag handle the user might have set, and use any point in the selection set as the "Last Point".

Here's a usable macro to move points a fixed distance. After selecting points, user may set or not set a drag handle. The macro will ignore any drag handle and arbitrarily use the first point in the buffer as a drag handle.

PS:
.... I wonder what dat means for da future ...
Hi Rob S,

Unbridled enthusiasm all around. 8)  Well, DT and Dr PR have made me think (normally a dangerous thing)

Best Regards,
BD   

PS: And still a dangerous thing. I'm guessing this method might require that the point relative command recognize that the user is engaged in a point move, and, rather than set a point, just move the points, as in the macro (mostly borrowed from the sdk) The command would still have to distinguish among a point drag handle, a reference point set for entity move command (which can be set on top of a selected point without disturbing the point selection), and a point set within a macro (eg the M macro, the only way I ever move entities). I'd be surprised if it's even possible to figure that out. 10:15 AM 10/26/18

Code: [Select]
'  pmr.d3m   point move relative         bdeck    10/2018

'  Macro to move a set of selected points by a user-input displacement

'  1) select an object
'  2) drag select one or more points on the object
'  3) run the macro 
'  4) enter x y z values of desired displacement

SETSELECTEDPOINTS

If Sys(1) < 1 Then
  Message "No points selected. Ending."
  end
End If

Pointval x y z 1 'get the first selected point

input "Input desired point displacement in X direction ", dx
input "Input desired point displacement in Y direction ", dy
input "Input desired point displacement in Z direction ", dz

>GroupPointsMove
{
  <Pointxyz [x, y, z]    'drag handle
  <PointRel [dx,dy,dz]  'displacement
}
« Last Edit: November 27, 2018, 02:08:36 PM by bdeck »

bdeck

  • Hero Member
  • *****
  • Posts: 932
Re: Point Relative Command
« Reply #22 on: October 29, 2018, 03:21:11 PM »
The solution:
Keep the Point Relative command exactly as it is, except:
   1) Add a control to allow user to convert (or unconvert) a currently selected Point Relative option to a default that subsequently overrides the option retained from a prior instance of Point Relative, while allowing user to select a current option that overrides the default within any single instance.
   2) Make all options available when doing point moves in point select mode.
   3) Never slam anyone into any option, especially "Last Cursor Position.
That's the whole plan. Period.      "
Ok, maybe this clarification should have been added:
   4) The Default option setting, if there is one, should persist between sessions. (preferably in an INI file) 

Having the most recent (non-default) option persist between sessions, as has been suggested,  is OK with me, but offers no additional benefit that I can see, provided that the default option has been implemented correctly.

And this would be a substantial improvement, from a prior post:
   5) A Restore key (such as [F12] which would not corrupt the numeric text fields or affect keyboard focus)  should be available to restore erased values from the numeric fields.

In that way, one could keep  "Always reset values to zero" checked constantly, and still be able to restore the cleared values, if necessary, to correct an error, or duplicate a prior operation. With "Always reset values to zero" checked, user would never have to zero unused fields when populating only one field.

.....The ["Last Point" option of the Point Relative] command would still have to distinguish among a point drag handle, a reference point set for an entity move command, ..... and a point set within a macro ....I'd be surprised if it's even possible to figure that out.
Wrong again! As it turns out, DC already does those things.

After further testing, the Point Relative command appears to recognize all the conditions listed below.

Using the "Last Point" option, when points have been selected in point select mode:
     1) If a user has set a grab handle for the point selection, Result =  Point Relative command recognizes that a grab handle has been set, and slams user to Last Cursor Position (point selection remains intact)
     2) If a user has set the first point after starting the Move from Reference Point command, Result =  Point Relative command sets a point at input offsets (point selection remains intact) 
     3) If, within the context of a macro, a user has set one or more points requested by a SETPOINT statement, or a Setpoints command, or an incomplete parameter in any command,  Result =  Point Relative command sets a point at relative offsets input by user. (point selection remains intact, depending on macro)
     4) If a user has set one or more points after starting a Drawing command, Result =  Point Relative command sets a point at relative offsets input by user. (point selection remains intact)
     5) If none of conditions (1) - (4) is true,  Result =  Point Relative command does not execute.  (point selection remains intact)

Although the above list may not be exhaustive, it appears that, when the PointRelative command is initiated by a user who has selected one or more points, DC has already gathered enough information to perform the desired operation using the "Last Point" option.

(Edit 1/28/19)  When user has chosen the "Last Point" option, and either condition (1) or (5) is true, the Point Relative command should  simply follow the steps outlined in the pmr macro. This will expedite moving the points without going through the unnecessary step of setting a point, regardless of whether user has set a grab handle or not.

If the resulting operation is one the user did not intend, the undo key will undo the point move. (But the undo will also undo the point selection, just as it does after any point move, even one using the "Reference Point" option. That would be a good "feature" to fix.)

(The term "grab handle" is coined here for the initial point set in a move of selected points.)
« Last Edit: January 28, 2019, 05:43:34 PM by bdeck »

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Point Relative Command
« Reply #23 on: November 07, 2018, 05:57:46 PM »

Code: [Select]
Pointval x y z 1   'get the first selected point
input "Input desired point displacement in X direction ", dx
input "Input desired point displacement in Y direction ", dy
input "Input desired point displacement in Z direction ", dz

Rather that forcing the user to input at 3 consecutive times, you can combine everything into one...
Code: [Select]
Pointval x y z 1    'get the first selected point
input "Input desired X, Y & Z point displacements (separate by commas)", dx, dy, dz


The user can then type all 3 values one time, separated by commas (spaces are not necessary but you can type them in after the first 2 commas. For only an X displacement just enter the X value and can leave out the Y and Z. For only a Y displacement you must type a zero for the X, enter the Y and can leave out the Z. For just a Z displacement you must type zeros for the X and Y and enter the Z value).




« Last Edit: November 07, 2018, 06:04:19 PM by Lar »

bdeck

  • Hero Member
  • *****
  • Posts: 932
Re: Point Relative Command
« Reply #24 on: November 12, 2018, 06:33:22 PM »
Rather that forcing the user to input at 3 consecutive times, you can combine everything into one...
     input "Input desired X, Y & Z point displacements (separate by commas)", dx, dy, dz

Hi Lar,

Good point. I wrote the macro according to my personal preference for ten-key input. Others will have a different preference.

Benefit of single-line method:
   1) you can review / edit all entries before hitting [Enter].
    
Benefits of 3-line method:
   1) you use the [Enter] key (part of the 10 key pad) as a delimiter for faster, easier, one-hand data entry.
   2) accepts any numeric expression with no commas necessary (single-line method requires commas if formulaic expressions are used)
   3) user never has to enter a value in any zero field. (Just hit [Enter])
 
Downside of both methods is that using Control-Z to undo a previous point move causes any selected points to be deselected. So after an undo, one must reselect all selected points.

This "feature" in DC should be eliminated.

In the meantime, here's a modification to the pmr macro that has a nondisruptive undo feature built in. (also includes single-line input method as an alternative)

Code: [Select]
'  pmr2.d3m  point move relative with undo feature         bdeck    11/2018

'  Macro to move a set of selected points by a user-input displacement
'  Adapted from SETSELECTEDPOINTS demo in SDK Macro Language Reference Manual
'  This version has a built-in verify/undo feature that does not disrupt the point selection

'  1) select an object
'  2) drag select one or more points on the object
'  3) run the macro 
'  4) enter x y z values of desired displacement
'  5) backspace to undo; or any other key or click to accept

SETSELECTEDPOINTS

If Sys(1) < 1 Then
Message "No points selected. Try again."
  end
end If

'input "Input desired X, Y, Z point displacements (separate by commas or spaces)", dx, dy, dz   'alternative input method

input "Input desired point displacement in X direction ", dx 
input "Input desired point displacement in Y direction ", dy
input "Input desired point displacement in Z direction ", dz

gosub ptmover

Print   " [Backspace] to undo;  any other key or click to accept"
anykey k

if k=8 then  ' if backspace key was pressed
dx=-dx
dy=-dy
dz=-dz
gosub ptmover
endif

end

ptmover:
Pointval x y z 1 'get the first selected point
>GroupPointsMove
{
  <Pointxyz [x, y, z]
  <PointRel [dx,dy,dz]
}
return


The solution:
Keep the Point Relative command exactly as it is, except:
   1) Add a control to allow user to convert (or unconvert) a currently selected Point Relative option to a default that subsequently overrides the option retained from a prior instance of Point Relative, while allowing user to select a current option that overrides the default within any single instance.
   2) Make all options available when doing point moves in point select mode.
   3) Never slam anyone into any option, especially "Last Cursor Position.
That's the whole plan. Period.   
......
OK, maybe [these clarifications] should have been added:
   4) The Default option setting should persist between sessions.  (current selection should never persist)
   5) A Restore key (such as [F12] which would not corrupt the numeric text fields or affect keyboard focus)  should be available to restore [prior] values from the numeric fields.

I cannot think of any reason to explicitly "unconvert" a default option. A single-purpose (non-toggling) "Make Default" button that changes the default to the current option should work fine, and it will eliminate the need for a toggle or a separate "undefault" button. This way, one of the options will always be the default, and changing the default to the currently selected option would require only a single click or keypress.

The Currently Selected option should never persist between instances of the command, or between sessions, unless it is also the Default option.  The Default option should always persist.

Edit:

Radio buttons should be used to indicate the Currently Selected option, just as they do now. When an instance of the Point Relative command is initiated, the Currently Selected radio button should always be set to the Default option, regardless of which option was previously selected. There is no need to otherwise indicate  which option is the default.

Thanks to Dr PR for pointing out that "reset values to zero" is worthless without a "restore values" button.

bd
« Last Edit: November 25, 2018, 10:19:20 PM by bdeck »

Dr PR

  • Hero Member
  • *****
  • Posts: 5682
Re: Point Relative Command
« Reply #25 on: February 12, 2019, 10:43:53 PM »
bd,

I am taking something out of context here, but it is very important that a point be made.

I take STRONG exception to you comment that the "currently selected option should never persist between instances of the command, unless it is the Default option."

Iff we have a way to define the Default, I would agree. But if the ability to set the Default for all future instances of the command is not provided, the last used option should continue to be selected when the command is restarted.

I use only the "Reference Point" option, and it is a nuisance having to select this option the first time I use the function after restarting the program. It would be an extreme nuisance to have to select it every time I start the command.

Phil
DesignCAD user since 1987

bdeck

  • Hero Member
  • *****
  • Posts: 932
Re: Point Relative Command
« Reply #26 on: February 14, 2019, 09:27:44 PM »
I take STRONG exception to your comment that the "currently selected option should never persist between instances of the command, unless it is the Default option."   If we have a way to define the Default, I would agree....
Hi DrPR,

Good point. I should have made it clear that I was just fleshing out the details of how DC should act in an ideal embodiment, wherein each user HAS the ability to choose the default option for the Point Relative Command. (as RobS had suggested)

Quote
I use only the "Reference Point" option, and it is a nuisance having to select this option the first time I use the function after restarting the program. It would be an extreme nuisance to have to select it every time I start the command.
Agreed.

I use mostly the Last Point option, but I occasionally use the Reference Point option. After using Reference Point, I also am annoyed when the next time I use the Point Relative Command to set a point, the command is not set to the option that I expect.

So we seem to agree that Rob's suggestion would be an improvement for both of us. But more so for me...  ;D

Many thanks for contributing to this thread, and tolerating my "thinking out loud."

bd

PS: Perhaps "RECALL VALUES" would be a more accurate name than "RESTORE VALUES" in the prior message.
« Last Edit: February 15, 2019, 10:31:18 AM by bdeck »