BIGAL 发表于 2022-7-5 17:37:19

我会按照李的建议使用他的剧本作者,但如果你想换一种方式的话
 
此处:
 
[列表]
[*]fname是块
[*]'(7.6911 3.3174)是插入点
[*]1.4是x刻度
[*]“”表示输入,即使用x刻度值作为y刻度
[*]0是旋转
[*]AV是一个用于设置属性值的变量
[/列表]
我建议进行以下更改:
(command "insert" fname '(7.6911 3.3174) 1.4 "" 0 AV)
但是,这仍然假设ATTREQ=1,并且块只有一个属性。要完全避免属性提示,只需将ATTREQ设置为0。

hidxb123 发表于 2022-7-5 17:40:52

先生
 
我更改了ATTREQ=0,并按如下方式编辑了代码,如果错误,请查看并编辑
 
(command "_.-insert" fname "_S" 1.4 "_R" 0.0 "_non" '(7.6911 3.3174) "YourAttributeValue")
 
 
 
 

BIGAL 发表于 2022-7-5 17:42:33

 
如果要将ATTREQ更改为0,则不应提供属性值:
9
您也不再需要输入和旋转响应,因为已经提供了这些响应(“\u S”1.4和“\u R”0.0)。
 
请花些时间研究我帖子中的评论,并在命令行手动输入-INSERT命令的提示,以便了解程序的工作方式。
 
我看到您还将函数定义更改为“c:dee”,因此,需要对其进行如下评估:
10

hidxb123 发表于 2022-7-5 17:48:03

Lee Mac 发表于 2022-7-5 17:48:29

In your DEE.lsp, I notice that your variable 'AV' is not defined - this will cause the Script to terminate.

hidxb123 发表于 2022-7-5 17:54:44

Sir,
 
Can you defined , i don't have any knowledge about this
 
 
 
 
 

Lee Mac 发表于 2022-7-5 17:56:36

 
How should I know what value to define it to use?
 
The variable is setting the attribute value for your block:

(command "insert" fname '(7.6911 3.3174) 1.4 "" 0 AV)Here:
 


[*]fname is the block
[*] '(7.6911 3.3174) is the insertion point
[*]1.4 is the x-scale
[*]"" means ENTER, i.e. use the x-scale value for the y-scale
[*]0 is the rotation
[*]AV is a variable to set the attribute value

I would suggest the following changes:

(command "_.-insert" fname "_S" 1.4 "_R" 0.0 "_non" '(7.6911 3.3174) "YourAttributeValue")
However, this still assumes that ATTREQ=1 and that your block has only a single attribute. To avoid the attribute prompt altogether, simply set ATTREQ=0.

hidxb123 发表于 2022-7-5 17:59:54

Sir,
 
I CHANGEDATTREQ=0 , And i edited the code as follows , please see and edit if its wrong
 

(defun c:dee( / fname)   (mapcar 'setvar '("cmdecho" "insunits" "dimasz") '(0 4 3.0))   (if (findfile (setq fname "c:\\hpc\\DE.dwg"))       (command "_.-insert" fname "_S" 1.4 "_R" 0.0 "_non" '(7.6911 3.3174) "" 0 AV)   ));dee
 
 
 
 

Lee Mac 发表于 2022-7-5 18:01:16

 
If you are changing ATTREQ to 0, you should not supply the attribute value:

(defun c:dee ( / fname )   (mapcar 'setvar '("cmdecho" "insunits" "dimasz") '(0 4 3.0))   (if (findfile (setq fname "c:\\hpc\\DE.dwg"))      (command "_.-insert" fname "_S" 1.4 "_R" 0.0 "_non" '(7.6911 3.3174))   ))
You also no longer require the ENTER & rotation responses, as these have already been supplied ("_S" 1.4 and "_R" 0.0).
 
Please take some time to study the comments in my posts, and also manually enter the prompts for the -INSERT command at the command-line so that you are aware of how your program works.
 
I see that you have also changed the function definition to 'c:dee', therefore, it will need to be evaluated as such:
_.open *file* (load "DEE.lsp" nil) (if c:DEE (c:DEE)) _.qsave _.close
页: 1 [2]
查看完整版本: 请帮我用LEE MAC