The Buzzard 发表于 2022-7-6 15:03:08

大家注意,
 
修改后的代码见第一篇文章。
对局部变量进行了更改。
如果有任何意见,我将不胜感激。
 
谢谢
秃鹰

flowerrobot 发表于 2022-7-6 15:08:21

你是怎么计算出向量图像的,主要是门的弧线。

The Buzzard 发表于 2022-7-6 15:10:16

嘿,花机器人,
 
我想知道什么时候会有人问我这个问题。
以下是步骤。
 
我只是把门拉到一个基本尺寸。
2、将门放置在屏幕中心。
我运行了一个名为mimage2的程序。lsp(该程序将使用一个图像生成一个对话框和lisp程序)。
4.创建程序时,它存储在C。
5.我打开程序,复制列表并将其粘贴到我的程序中。(我只是相应地格式化它)。
6、我对每张图片都这样做。
 
由于函数的大小,我在这里显示了函数中的第一个和最后一个图像。您可以参考代码中的完整函数。
 

;;; 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 widthcoordinate for imG1
       h (dimy_tile "imG1"))                                       ;Set height coordinate for imG1
(start_image "imG1")                                              ;Start image imG1
(fill_image 0 0 w h -15)                                          ;Fillimage
(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
       (list36373637363736373736364141
            32413232414132324137414137
            37 119 119 119 119 119 119 118 118 118 117 117 116
             116 115 114 114 113 112 111 110 109 108 107 106 105
             104 103 102 101999897959492918988
            86848381797876747270696765
            63615957555351494745434040
            33403334404034334033344034
            40403334404033)
       (list95958695868695958686959190
            919091909190909191   8   89191
               8918987858381797775737169
            67656361595856545250494745
            44424039373634333130292726
            25242321201918171716151413
            13121211111010   9   9   9   99494
            88948887949487889494948794
            87889494888794)
       (list37363636373737373636364132
            41323241413232414141413737
            37 119 119 119 119 119 118 118 118 117 117 116 116
             115 114 114 113 112 111 110 109 108 107 106 105 104
             103 102 10199989795949291898886
            84838179787674727069676563
            61595755535149474543414033
            40333440403433404034403340
            40343440403333)
       (list95869586869595868695959091
            919190909090919191   89191   8
               8898785838179777573716967
            65636159585654525049474544
            42403937363433313029272625
            24232120191817171615141313
            121211111010   9   9   9   9   99488
            94888794948788949494879487
            88949488879494)
       (list   1   1   1   1   1   1   1   1   1   1   1   1   1
               1   1   1   1   1   1   1   1   116161616
            16161616161616161616161616
            16161616161616161616161616
            16161616161616161616161616
            16161616161616161616161616
            1616161616161616161616   1   1
               1   1   1   1   1   1   1   1   1   1   1   1   1
               1   1   1   1   1   1   1)))

   ((= D:IMG "LEFT-RIGHT45IN")                                     ;D:IMG ~ (Door Image) = D:SWG ~ (LEFT-RIGHT) D:ANG ~ (45) D:IPT ~ (IN)
   (mapcar 'vector_image                                       ;Start mapcar
       (list78787878787777777676767574
            74737272717069686766656463
            62619996 147 15099969594939291
            90898887868584838382818180
            808079797978787878   8   9   8   9
               8   9   8   9   9   8   81313   513   5   5
            1313   5   5135760   9   6571112   6
            12   6   61112   6   611   6   611   611
            12   6   61211   6)
       (list88868583817977757372706866
            64636159575654525149484645
            43423740918837404243454648
            49515254565759616364666870
            72737577798183858695958795
            87879595878795929192919291
            92919192923740918837949389
            93898894938889949394889488
            899394898893)
       (list78787878777777767676757474
            73727271706968676665646362
            616096 147 1509999959493929190
            89888786858483838281818080
            807979797878787878   9   8   8   8
               9   9   9   9   8   8   813   513   5   513
            13   5   5131360   9   6575712   611
               6   61212   6   61111   611   61112
               6   61211   6   6)
       (list86858381797775737270686664
            63615957565452514948464543
            42404091883737424345464849
            51525456575961636466687072
            73757779818385868895879587
            87959587879595919292929191
            91919292924091883737938994
            89889393888994949488938889
            949489889393)
       (list16161616161616161616161616
            16161616161616161616161616
            16161616161616161616161616
            16161616161616161616161616
            161616161616161616   1   1   1   1
               1   1   1   1   1   1   1   1   1   1   1   1   1
               1   1   1   1   11616161616   1   1   1
               1   1   1   1   1   1   1   1   1   1   1   1   1
               1   1   1   1   1   1))))
(end_image)                                                       ;End   image
)                                                                   ;End   define function
 
还有什么问题,尽管问吧。
谢谢
秃鹰

The Buzzard 发表于 2022-7-6 15:12:49

这是图片上的完整线索。
您可以从这里下载代码,只需确保您复制了最新版本。
 
http://autolisp-exchange.com/Forums/Forum4/F4T18P1.htm
 
 
秃鹰

The Buzzard 发表于 2022-7-6 15:15:42

更具体地说,
 
我对一种类型的门使用了多个图像。
选择的组合会更改这些图像。
 
例如
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 widthcoordinate for imG1
       h (dimy_tile "imG1"))                                       ;Set height coordinate for imG1
(start_image "imG1")                                              ;Start image imG1
(fill_image 0 0 w h -15)                                          ;Fillimage
(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

flowerrobot 发表于 2022-7-6 15:18:23

哇,谢谢你,这比sld好多了。
这很简单。
 
谢谢你这么说

The Buzzard 发表于 2022-7-6 15:21:39

欢迎光临,
还有什么事,就问吧。

flowerrobot 发表于 2022-7-6 15:24:48

*编辑,修复了错误
 
是他们的任何类型的东西,图像或类似的,可以合成成一个vlx。因为我想把这一切都保存在一个简单的文件里。因此,为什么我认为矢量图像,虽然它是好的,我想把我的图像在三维到远处的一个很好的渲染。
下面是我使用的代码。
它将转到一个tile_按钮。

The Buzzard 发表于 2022-7-6 15:29:34

Flowerrobot,
 
如果你有完整的代码,让我看看,这样我可以让你知道问题出在哪里。

The Buzzard 发表于 2022-7-6 15:32:49

我相信它会起作用,不过图像按钮的工作方式有点不同。
它可能也必须以不同的方式书写。我使用的显示器与弹出列表配合使用。如果你愿意,我很乐意帮你。
页: 1 [2]
查看完整版本: 我第500次和9/10次尝试