The following code will demonstrate
1. Modify the prompt string of SSGET
2. Enter keyword B in SSGET, enter the callback function, and modify the current filling settings without exiting SSGET.
![](http://www.theswamp.org/index.php?action=dlattach;topic=58785.0;attach=41609;image)
;|
xdrx-initssget
Parameters: 1: ssget prompt string
2: Keywords
3: Prompt string when removing an object
4: Callback function
|;
(xdrx-initssget
"\nPick the curve to be created [Fill Mode(B)]<Exit>:"
"B" "" "_keyword"
)
(setq ss
(xdrx
-ssget '
((0 .
"*line,arc,circle,ellipse,spline,*polyline"))))
;|
Selection set callback function, after entering keyword B, enter processing
|;
((= key "B")
(if (= #xd_var_region_hatch
0) (setq #xd_var_region_hatch
1) (setq #xd_var_region_hatch
0) )
)
)
(_prompt)
)
(xdrx_initget "B")
(xdrx_prompt
"\nCurrent settings: *** REGION FILL Mode: "
(= #xd_var_region_hatch 0)
"YES ***"
"NO ***"
)
)
)
(if (not #xd_var_region_hatch
) (setq #xd_var_region_hatch
0) )
(_prompt)
;|
xdrx-initssget
Parameters: 1: ssget prompt string
2: Keywords
3: Prompt string when removing an object
4: Callback function
|;
(xdrx-initssget
"\nPick the curve to be created [Fill Mode(B)]<Exit>:"
"B" "" "_keyword"
)
(setq ss
(xdrx
-ssget '
((0 .
"*line,arc,circle,ellipse,spline,*polyline")))) )
(if (setq ss
(xdrx
-geom
-searchregions ss t
)) ;Construct closed regions
(xdrx-begin)
(if (= #xd_var_region_hatch
0) (setq e
(xdrx
-hatch
-make x
) ; Create hatch clr (xdrx-math-rand 1 50)
;1-50 random number
)
(xdrx-entity-setcolor e clr) ;Set color
)
(xdrx-pickset->ents ss)
)
)
)
(xdrx-end)
)
)
)
)
)