PDA

View Full Version : low-level graphics



Coolmo
2005-02-02, 02:47 PM
Is it possible to create low-level graphics in VBA? If yes, can someone throw some simple code my way? If no, does someone have a trick that they may use? I want to place a tic mark (i.e. "X") on a certain point selected by the user but would like to NOT use entities if possible. Thanks.

Jeff_M
2005-02-02, 05:23 PM
Is it possible to create low-level graphics in VBA? If yes, can someone throw some simple code my way? If no, does someone have a trick that they may use? I want to place a tic mark (i.e. "X") on a certain point selected by the user but would like to NOT use entities if possible. Thanks.

Here's something I whipped up to do this that uses lisp and (grdraw). First, save the code as a .lsp file and load it into acad, I'd add it to my startup suite. Then use code similar to what I show in your VBA macro........



;; Marker for point location on the screen
;; Oct. 2004 by Jeff Mishler
(defun Xmarksthespot (x y / leglen start)
(setq start (list x y)
leglen (* 0.03 (getvar "viewsize"))
)
(grdraw (polar start (angtof "135" 1) leglen)
(polar start (angtof "315" 1) leglen)
7)
(grdraw (polar start (angtof "45" 1) leglen)
(polar start (angtof "225" 1) leglen)
7)
)

;;Sample call from VBA

;;Sub test()
;;Dim pt
;;Dim x As Double
;;Dim y As Double

;;pt = ThisDrawing.Utility.GetPoint
;;x = pt(0)
;;y = pt(1)
;;ThisDrawing.SendCommand ("(xmarksthespot " & x & " " & y & ") ")

;;End Sub