Costinbos77 发表于 2022-7-6 06:58:45

Problems with vla-move and OSM

Hi there,
 
I want to use vla-move and benefit from OSMODE properties.
 

(defun c:Test () ; (entmake (list '(0 . "TEXT") '(10 0 0 0) (cons 40 1) (cons 41 1) (cons 50 0) '(11 0 0 0) (cons 1 "Text") )) ;_ end of entmake(setq vob (vlax-ename->vla-object (entlast))p1 (vlax-3D-point '(0 0 0)) ) ;_ end of setq(while (and vob (progn   (and (not (member (setq gr (grread T 15 0)vt (cadr gr)cd (car gr)) '(3 25)) )      (not (member vt '(13 32)) )) ; Enter , Spatiu) ;_ end of prog cond ) ;_ end of and (if (and (member cd '(3 5)) vob) (progn (setqp2 (vlax-3D-point (cadr gr)) ) (vla-Move vob p1 p2) (setq p1 p2) )) ;_ end of if not) ;_ end of wh) ;_ end of defun
 
It is possible?
 
Thanks in advance.

Lee Mac 发表于 2022-7-6 07:25:03

 
The grread function will pause to detect user input and will return a list of data pertaining to the type of input received . However, whilst pausing to detect input, all standard drawing aids are disabled (e.g. Object Snap, Polar Tracking, Orthomode etc.). Hence, when calling the grread function within a while loop, such drawing aids are continuously disabled within the loop.
 
Orthomode can quite easily be imitated by manipulation of the cursor coordinates based on the X & Y values of the cursor position; however, the only way to achieve Object Snap functionality within a grread loop (that is, without resorting to ObjectARX as used by DynDraw by Alexander Rivilis), is to use the osnap AutoLISP function to continuously attempt to snap the cursor position using the active Object Snap modes, and display a grvecs/grdraw vector to imitate the Object Snap symbol on-screen.
 
Here is one example of such an imitation, and here is another.

Costinbos77 发表于 2022-7-6 07:43:55

Thanks Lee.
 
What we saw in the first example, is very interesting. I think will find there what I want and something more.

Lee Mac 发表于 2022-7-6 08:11:43

You're welcome.
页: [1]
查看完整版本: Problems with vla-move and OSM