Author Topic: Dragging block with DynDraw  (Read 1228 times)

0 Members and 1 Guest are viewing this topic.

velasquez

  • Newt
  • Posts: 176
Dragging block with DynDraw
« on: February 03, 2016, 05:48:48 AM »
Code: [Select]
(defun c:DynDrawTest (/ step blk Obj point)
  (setq step 1e-6)
  (setq blk (car (entsel "\nSelect a block: "))
;;; pt     (dxf 10 (entget blk)) ;_ fim de dxf
;;; LastPt pt
Obj (vlax-ename->vla-object blk)
  ) ;_ fim de setq
  (defun JoyCallBackTest (point /)
    (setvar "nomutt" 1) ;_ suppresses the "regen ..." prompt
    (cond
      ((= (type point) 'STR)
       (vla-update Obj)
      )
      ((vl-consp point)
       (or prev (setq prev point))
       (if (< step (distance prev point))
(progn
   (setq prev point)
   (vla-put-InsertionPoint Obj (vlax-3D-point point))
   (vla-update Obj)
) ;_ fim de progn
       ) ;_ fim de if
      )
    ) ;_ fim de cond
    (setvar "nomutt" 0)
    point
  ) ;_ fim de defun
;;;
;;;Define a funcao p/ DynDraw.arx
  (vl-acad-defun 'JoyCallBackTest)
  (setq
    point
     (dyndraw "JoyCallBackTest"
      "\nSpecify insertion point: [Enter Exit]: "
      "" ;_ Keyword string
      (+ 2 128 2048)
      -1
      nil
     ) ;_ fim de dyndraw
  ) ;_ fim de setq
;;;
  (if (vl-consp point)
    (progn
      (vla-put-InsertionPoint Obj (vlax-3D-point point))
      (vla-update Obj)
    ) ;_ fim de progn
  ) ;_ fim de if
;;;
  (vl-acad-undefun 'JoyCallBackTest)
  (princ)
)

The above code works well with DynDraw 2010 x64.arx in AutoCAD 2010.
But with higher versions the object is not shown during the drag.
Can anyone tell me why?



« Last Edit: February 04, 2016, 12:22:48 PM by velasquez »

velasquez

  • Newt
  • Posts: 176
Re: Dragging block with DynDraw
« Reply #1 on: February 11, 2016, 02:14:51 PM »
Can someone please test the code I posted in a later version to AutoCAD 2010?
Any feedback would be helpful.

DW

  • Newt
  • Posts: 22
Re: Dragging block with DynDraw
« Reply #2 on: February 15, 2016, 06:45:02 PM »
It displays and drags without issues in 2016.  I've noticed some display problems with complex blocks in earlier versions of AutoCAD > 2009 but later versions seem to be ok.

Hugo

  • Bull Frog
  • Posts: 308
Re: Dragging block with DynDraw
« Reply #3 on: February 16, 2016, 01:32:36 AM »
I can in 2016 not test because I can not load the DynDraw.arx.   :oops:

Ich kann das in 2016 nicht Testen da ich die DynDraw.arx nicht laden kann.

velasquez

  • Newt
  • Posts: 176
Re: Dragging block with DynDraw
« Reply #4 on: February 16, 2016, 05:30:32 AM »
Thanks for the answers.
I noticed the biggest problem in AutoCAD 2012.

Alexander Rivilis

  • Bull Frog
  • Posts: 212
  • Programmer from Kyiv (Ukraine)
Re: Dragging block with DynDraw
« Reply #5 on: April 21, 2016, 01:50:22 AM »