更具体地说,
我对一种类型的门使用了多个图像。
选择的组合会更改这些图像。
例如
1、左门与外部插入点成90度摆动。
2、左门与内侧插入点成90度摆动。
3、左门与外部插入点成45度摆动。
4、左门与内侧插入点成45度摆动。
下面附加的代码是导致图像更改的主要功能的一部分。
- (IDS_UDI D:IMG) ;Goto IDS_UDI Image Function ~ D:IMG (Door Image) is the argument
- (action_tile "LEFT" ;When radio_button Single Door - Left is selected, KEY is LEFT
- "(IDS_UDI (setq D:SWG "LEFT"))") ;Goto IDS_UDI Image Function, Set variable D:SWG ~ (Door Swing) to LEFT
- (action_tile "RIGHT" ;When radio_button Single Door - Right is selected, KEY is RIGHT
- "(IDS_UDI (setq D:SWG "RIGHT"))") ;Goto IDS_UDI Image Function, Set variable D:SWG ~ (Door Swing) to RIGHT
- (action_tile "LEFT-RIGHT" ;When radio_button Double Door is selected, KEY is LEFT-RIGHT
- "(IDS_UDI (setq D:SWG "LEFT-RIGHT"))") ;Goto IDS_UDI Image Function, Set variable D:SWG ~ (Door Swing) to LEFT-RIGHT
- (action_tile "90" ;When radio_button 90° Angle is selected, KEY is 90
- "(IDS_UDI (setq D:ANG "90"))") ;Goto IDS_UDI Image Function, Set variable D:ANG ~ (Door Angle) to 90
- (action_tile "45" ;When radio_button 45° Angle is selected, KEY is 45
- "(IDS_UDI (setq D:ANG "45"))") ;Goto IDS_UDI Image Function, Set variable D:ANG ~ (Door Angle) to 45
- (action_tile "OUT" ;When radio_button Outside Pivot is selected, KEY is OUT
- "(IDS_UDI (setq D:IPT "OUT"))") ;Goto IDS_UDI Image Function, Set variable D:IPT ~ (Door Insertion Point) to OUT
- (action_tile "IN" ;When radio_button Inside Pivot is selected, KEY is IN
- "(IDS_UDI (setq D:IPT "IN"))") ;Goto IDS_UDI Image Function, Set variable D:IPT ~ (Door Insertion Point) to IN
这部分代码结合了上述键的选择。
我创建了一个名为D的变量:IMG作为参数。通过组合变量D:SWG、D:ANG和D:IPT进行设置。
当选择这些变量组合中的任何一个时,我使用条件转到使用mimage2创建的特定图像列表。lsp。(列表示例请参阅第13篇文章)
- ;;; F09 - Image Function - Update Door Image. ;Function Description
- (defun IDS_UDI (D:IMG) ;Define function, D:IMG ~ (Door Image) is the argument
- (setq D:IMG ;Set Door Image
- (strcat ;Concatenate string
- ""(eval D:SWG)""(eval D:ANG)""(eval D:IPT)"")) ;Evaluate D:SWG ~ (Door Swing) D:ANG ~ (Door Angle) D:IPT ~ (Door Insertion Point)
- (setq w (dimx_tile "imG1") ;Set width coordinate for imG1
- h (dimy_tile "imG1")) ;Set height coordinate for imG1
- (start_image "imG1") ;Start image imG1
- (fill_image 0 0 w h -15) ;Fill image
- (cond ;If one of the following conditions apply
- ((= D:IMG "LEFT90OUT") ;D:IMG ~ (Door Image) = D:SWG ~ (LEFT) D:ANG ~ (90) D:IPT ~ (OUT)
- (mapcar 'vector_image ;Start mapcar
|