Author Topic: macros start at wrong point  (Read 831 times)

Rob S

  • Hero Member
  • *****
  • Posts: 4535
    • Construction Estimating Program for General Contractors
Re: macros start at wrong point
« Reply #15 on: March 13, 2018, 07:16:12 PM »
Lar

Using V26 I am able to reproduce his result, using the sample macro as included in the third post above, just remove the opening square bracket, leaving in the >setstartpoint portion.

In a new blank drawing, create a mirrorable object - ie one where you can tell which way it was mirrored, and select it.  Observe the handle location.

Run the macro, which asks for a start point, and upon setting a point, the handle of the Y axis mirrored object is placed at the selected location - ie works as intended

Use the menu command "points, origin", to relocate the origin of the drawing.

Run the macro again, and the mirrored object is placed at a location measured from the new origin, the same distance as the start point is set from the original "cached" origin.

Save, close and re-open the file, and the macro works as intended regardless of the origin location.


User since Pro-design

Lar

  • Hero Member
  • *****
  • Posts: 2815
Re: macros start at wrong point
« Reply #16 on: March 13, 2018, 08:49:48 PM »
Yea, Rob. I followed Rccon's instructions in his last post and got his results. It seems like Rccon uncovered a bug, but since I hardly ever used >SetStartPoint I can't say if this is somehow the expected result, for those who do use setstartpoint.

What I have deduced is this: when you change the origin of the drawing not everything gets the memo, >SetStartPoint included. So, when you set the start point, it coordinates itself in relation to the original origin. Meanwhile, the commands did get the memo that the origin has changed so they carry out their instructions in relation to the new origin. Hence, the differential. I personally stopped changing my origin because when I export to Cinema 4D to render/animate, Cinema 4D always used the original origin, not the new one. So I guess the exporter don't get the memo either.

The good thing is Rccon's solution is quite simple. Just don't ever change the origin. In fact his problem was caused by him changing the origin. Changing the origin is totally unnecessary as long as >SetStartPoint is there at the beginning of the macro and the commands in the macro has the <pointxyz being set at 0,0,0. If he does have to change the origin for some other purpose, change it back to its original location before running the macro


Lar
« Last Edit: March 14, 2018, 08:32:55 AM by Lar »

rccon

  • Full Member
  • ***
  • Posts: 125
Re: macros start at wrong point
« Reply #17 on: March 14, 2018, 06:48:03 AM »
So I guess the reason I've had this problem and others have not is that I'm the only one who commonly changes he origin, and maybe it's a bad habit that will need to change. Often I want to know the vertical & horizontal distances of several points from a certain point in a drawing. I can use the distance command, but it is quicker & easier to set the origin at my reference point, click once at each point in question and read the coordinate bar. I've found other uses, too. As a keyboard guy, I'm always trying to get out of mousework. Is there any chance programmers will address this issue?

Lar

  • Hero Member
  • *****
  • Posts: 2815
Re: macros start at wrong point
« Reply #18 on: March 14, 2018, 08:41:00 AM »

Is there any chance programmers will address this issue?
I reported it in Bug Reports. The new programming team as been doing a good job at squashing bus lately.


I can use the distance command, but it is quicker & easier to set the origin at my reference point,
The distance command ("Angle & Distance between points", Dimensions menu>Info...) has lots of features, like showing the direct distance as well as the deltaX, deltaY and deltaZ, being able to change the tolerance, change the units and how the result are displayed. Give it a custom key so it's easy to invoke. I changed mine to "U", which is normally for the "Units" command, and I changed Units to Alt+U. <<thanks to DT for giving me that bit of advice some years back>>


Lar
« Last Edit: March 14, 2018, 08:59:47 AM by Lar »

rccon

  • Full Member
  • ***
  • Posts: 125
Re: macros start at wrong point
« Reply #19 on: March 14, 2018, 07:01:05 PM »
Thanks, guys. Now that I understand the source of problem I should be able to work around it.

rccon

  • Full Member
  • ***
  • Posts: 125
Re: macros start at wrong point
« Reply #20 on: April 29, 2018, 01:10:52 PM »
Six weeks later, I'm happy to report that I've got in the habit of using the distance command a lot more and find it a good substitute for my old habit of changing the origin. It still would be nice to get the bug fixed, though. There may be times when it would be nice to set the origin and then be able to read the coordinates of many points with a single click each, and not screw up the working of macros. Also, I have been known to hit the 0 key by accident and reset the origin without knowing it.