How to preview

How to preview

zph
Collaborator Collaborator
1,139 Views
3 Replies
Message 1 of 4

How to preview

zph
Collaborator
Collaborator

Good day!

 

I want to be able to imitate the HATCH preview option within one of my routines.

 

Here is an example:

 

There is an object I am creating through my routine.  I want the object, before the routine is complete and the object created, to 'preview' to the LEFT or the RIGHT of a previously selected point based upon the current location of the mouse pointer.  (i.e. if the pointer is to the LEFT of the selected point, the preview of the object will display to the left of the point...)  A mouse click will then execute the generation of the object.

 

I think I recall reading that there is a way to do this (a while ago), but I was unsuccessful in my searches.

 

Is there a way to do this?

 

Thanks!

0 Likes
1,140 Views
3 Replies
Replies (3)
Message 2 of 4

zph
Collaborator
Collaborator

I suppose the way the OFFSET command functions is a better example of the style of execution I am looking for.

0 Likes
Message 3 of 4

marko_ribar
Advisor
Advisor

Use (grread) function to get coordinates of mouse moving around center of UCS... Use vector analytic to acquire difference between X coordinate of mouse position and X coordinate of reference point (not 0,0,0 of UCS)... When mouse is on left side automatically create left entity and when it crosses reference point to the right automatically erase left entity and create right one and opposite... (while) grread loop should be active all the way until you press left mouse click and (car (grread)) = 3... Only then you terminate (while) loop and deactivate grread, leaving resulting left/right entity present... This is the simplest explanation and maybe you need not left/right but perpendicularity to reference line like OFFSET, but similarly you can imitate and this process - for this I suggest that you use (clockwise-p p1 p2 p3) sub function and checking between (grread) coordinates and reference line end points - if it returns T then (grread) reads left/right point to reference line and opposite if it returns nil then it's right/left to reference line...

 

HTH, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 4 of 4

john.uhden
Mentor
Mentor

What occurs to me is that you complete your function, highlight the result, and provide a means of exit to accept or reject.  The rejection would cause an Undo to restore things to before the function took action.  While the user is thinking, he can still transparently zoom/pan to his liking (left, right, up, down, in, out, whatever).  Then again, why not let him just complete the function, and if he doesn't like the results he can just Undo.

John F. Uhden