我有一个包含三个属性的块,分别表示窗口的宽度、长度和平方英尺。我编写了一个简单的代码,将块插入到图形中,并根据用户需要重复。问题是,-Insert命令产生了一个错误,产生了一个“无效的选项关键字”错误消息。
-
- (defun c:ATO-Windows ()
- (c:utility-start)
- (setvar "osmode" 0)
- (SETVAR "TEXTEVAL" 1)
- (setq ATOLayer "AreaTakeOff-Window"
- ATOLayerColor "143"
- ATOLineType "Continuous"
- ATOBlkWPath "C:/ACAD2008/HVAC/BLOCKS/ATTR-WINDOW"
- )
- (command "layer" "on" ATOLayer "thaw" ATOLayer
- "m" ATOLayer "C" ATOLayerColor
- ATOLayer "Ltype" ATOLineType ""
- )
- (setq continue "T")
- (while continue
- (setq WindowLength "0"
- WindowWidth "0"
- )
- (setq WindowLength (getstring "\nEnter Window Length in feet: "))
- (setq WindowWidth (getstring "\tWidth in feet: "))
- (setq RealLength (atof WindowLength)
- RealWidth (atof WindowWidth)
- )
- (setq RealArea (* RealLength RealWidth))
- (setq WindowArea (strcat (rtos RealArea 2 2) "SF"))
- (SETVAR "ATTDIA" 0)
- (terpri)
- (if (> RealArea 0.0)
- (command "-insert" ATOBlkWPath "Scale" (getvar "Userr3") Pause "0"
- WindowLength WindowWidth WindowArea
- )
- (setq continue nil)
- ) ;end if
- ) ;end while
- (c:utility-end)
- (SETVAR "ATTDIA" 1)
- ) ;end c:ATO-Windows
块连接,设置测试此代码的路径。我不明白为什么我会出错。也许一双新的眼睛会发现一些东西。
谢谢
氯
属性窗口。图纸 |