Page 1 of 1

How to set grid origin in D4D

PostPosted: Wed Mar 13, 2019 4:35 pm
by dhs
Hi,
Classic DCAL defined GridOrgX and GridOrgy processing variables. You could assign vales to these to change the grid origin on the current layer.

I have not found any direct equivalents to these in D4D, but the layer record contains a GridOrg field, so I assumed that assigning a value to this field would update the grid origin for the appropriate layer. But this does not appear to be the case.

I have the following code:
Code: Select all        if l.getp.Result = res_normal then begin
          if lyr_get (getlyrcurr, rlyr) then
            rlyr.gridorg := l.getp.curs;

The above code is updating the gridorg field correctly, but the grid origin is not being updated (e.g. the snap origin is not being changed, regening the display (U) is not redisplaying the grids with the new origin).

Does anybody know what is the correct method to change the grid origin in DCAL for Delphi ?

Thanks,
David H

Re: How to set grid origin in D4D (RESOLVED)

PostPosted: Wed Mar 13, 2019 4:47 pm
by dhs
Found my problem .... I simply needed to add a lyr_put call to 'save' the layer after updating the gridorg field.