嗯,我不知道有这么大的区别。不管怎样,我运行了你的例行程序,它确实与普林的工作。但它没有做我想要的,所以我回去重新写了一遍。这就是我现在拥有的:
- (defun c:guy_rope1 (/ pline SUCE SUSM SUCL SUCR rope_block)
- (setq SUCE (getvar "cmdecho"))
- (setq SUSM (getvar "osmode"))
- (setq SUCL (getvar "clayer"))
- (setq SUCR (getvar "cecolor"))
- (setq vl1 (list
- (cons 0 "LAYER") ;Name of entity
- (cons 100 "AcDbSymbolTableRecord") ;Open Records
- (cons 100 "AcDbLayerTableRecord") ;Locate Layer Table
- (cons 2 "CCC_SURVEY_Existing Stay or Guy Rope") ;Name of Layer
- (cons 62 1) ;colour = light grey
- (cons 70 0) ;state
- (cons 290 1) ;1=plot, 0=Don't plot
- ) ;End of entity list
- )
- (entmake vl1)
- (setvar "clayer" "CCC_SURVEY_Existing Stay or Guy Rope")
- (setvar "cecolor" "Bylayer")
-
- (princ "\nDraw an stay or guy rope line: ")
- (setvar "plinegen" 1)
- (command "._pline")
- (while (= 1 (logand 1 (getvar "cmdactive")))
- (command pause))
- (setq pline (entlast)
- elist (entget pline)
- )
- (setq name "guy_rope_survey")
- (command ".-Insert" name pause pause "" )
- (setq rope_block (entlast)
- elist (entget rope_block)
- )
- (command "explode" rope_block)
- (setvar "cmdecho" SUCE)
- (setvar "osmode" SUSM)
- (setvar "clayer" SUCL)
- (setvar "cecolor" SUCR)
- (princ)
- )
我有一些问题,也许有人可以帮我解决。这是例程的第一个aprt的命令转储:
命令:guy\u rope1
画一条拉线或拉线_普林线
指定起点:
当前线宽为0.0000
指定下一点或[弧/半宽/长度/撤消/宽度]:
指定下一点或[弧/闭合/半宽/长度/撤消/宽度]:
为什么会这样_普林出现了?
我的图层变量没有重置。我的图层没有恢复到原始值。
还有谁有更好的方法来运行insert,这样用户就可以使用动态块的对齐功能,而不必右键单击来完成命令?
谢谢 |