;|
Function name: XD::Pnt:Mark
Calling format: (XD::Pnt:Mark p col)
Parameter description: p ---- point
col -- color
Return value: t
Function introduction: Draw point markers
Function source: original
Function author: Free-lancer
Applicable versions: no limit
Last updated: 2014-09-22
|;
(defun XD::Pnt:Mark
(p col asratio
/ p1 p2 p3 p4 vs
) (polar p
(/ pi
4) (* vs asratio
)) (polar p
(* pi
1.25) (* vs asratio
)) col
(polar p
(* pi
0.75) (* vs asratio
)) (polar p
(* pi
-0.25) (* vs asratio
)) col
(setq p1
(polar p
(* pi
0.75) (* vs
(* (/ asratio
3.0) 2.0)))) (setq p2
(polar p
(/ pi
4) (* vs
(* (/ asratio
3.0) 2.0)))) col
p2
(setq p3
(polar p
(* pi
-0.25) (* vs
(* (/ asratio
3.0) 2.0)))) col
p3
(setq p4
(polar p
(* pi
1.25) (* vs
(* (/ asratio
3.0) 2.0)))) col
p4
p1
)
)
t
)
(defun XD::Pnts:Mark
(p col asratio
/ p1 p2 p3 p4 vs
) (xd::pnt:mark x col asratio))
p)
t
)
The code demonstrates how to let the general drag function "xd::drag:simplemove" handle the callback function "_split-callback" of this program. During the dragging process, if the screen is zoomed, the xd::pnt:mark function is called to always draw the starting point. , the end vector point.
;|
let the xd::drag:simplemove execute the callback function
When the screen is zoomed, the starting point of vector
drawing is always
|;
(defun _split
-callback
(dynpt
) (xd::pnt:mark p1 2 0.02)
(xd::pnt:mark p2 2 0.02)
)
(xdrx-begin)
(xdrx-sysvar-push '("osmode" 12))
e
(xdrx
-entsel "\nPick Polyline<Exit>:" '
((0 .
"*polyline"))) )
)
(setq inx1
(xdrx
-getpropertyvalue e
"nearindex" (trans p1
1 0)) p1 (xdrx-getpropertyvalue e "pointat" inx1)
)
(xd::pnt:mark p1 2 0.02)
(setq inx2
(xdrx
-getpropertyvalue e
"nearindex" (trans p2
1 0)) p2 (xdrx-getpropertyvalue e "pointat" inx2)
)
(xd::pnt:mark p2 2 0.02)
(setq ge
(xdge::constructor e
) from (xdge::getpropertyvalue
ge
"paramof"
(xdrx-getpropertyvalue e "pointat" from)
)
to (xdge::getpropertyvalue
ge
"paramof"
(xdrx-getpropertyvalue e "pointat" to)
)
intv (xdge::constructor "AcGeInterval" from to)
)
)
(xdge::setpropertyvalue ge "setinterval" intv)
(setq pl
(xdge::entity:make ge
)) (xdrx-entity-matchprop e pl)
(XD::Drag:CallBackSetMouseMove "_split-callback")
;|
Let the xd::drag:simplemove drag function additionally execute
the callback function "_split-callback" of this program
|;
(xd::drag:simplemove pl "\nInsert Point:" 5 t)
)
)
(xdrx-sysvar-pop)
(xdrx-end)
)