欢迎来到天天文库
浏览记录
ID:38423521
大小:71.00 KB
页数:3页
时间:2019-06-12
《练习LISP程序设计》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、;;;1将现有图中的直线移到指定的图层。(图层由用户确定)(Defunc:LX1(/lyss1nientnmb)(Setqly(Getstring"Layer:"));;;输入指定的图层名(Setqss1(Ssget"x"'((0."line"))));;;现有图中直线的选择集(Command"change"ss1"""p""la"ly""))Command:changeSelectobjects:1foundSelectobjects:Properties/:pChangewhatproperty(Color/Elev/LAyer/L
2、Type/ltScale/Thickness)?laNewlayer<0>:linChangewhatproperty(Color/Elev/LAyer/LType/ltScale/Thickness)?Command:CHANGE;;;;;;2将现有的多段首尾相接的直线编辑成多义线。(Defunc:LX2()(Setqss(Ssadd));;;定义一个空选择集(Setqssi(Entsel));;;(Entselprompt)返回所选实体的名称及选取该实体的选点坐标。只能用点去选,不能用Window选,提示参数的缺省值是Selectobjects.(While(/
3、=ssi'nil)(Ssadd(carssi)ss)(Setqssi(entsel)))(Setqentnm(Ssnamess0));;;(Ssnamessn)获得选择集ss中的第n个图元名(Command"pedit"entnm"y""j"ss"""x"))Command:peditSelectpolyline:Close/Join/Width/Editvertex/Fit/Spline/Decurve/Ltypegen/Undo/eXit:jSelectobjects:1foundSelectobjects:1foundSelectobjects:1fou
4、ndSelectobjects:1foundSelectobjects:1foundSelectobjects:1found(1duplicate)Selectobjects:4segmentsaddedtopolylineOpen/Join/Width/Editvertex/Fit/Spline/Decurve/Ltypegen/Undo/eXit:xCommand:;;;3改变现有图中所有圆的颜色。(颜色由用户确定)(Defunc:LX3()(Setqcol(Getint"Color:"))(Setqss1(Ssget"x"'((0."circle")
5、)))(Command"change"ss1"""p""c"col""));;;4改变用户所选定实体的线型。(线型由用户确定)(Defunc:LX4()(Setqlt(Getstring"Linetype:"))(Setqnm(Car(Entsel"SELECTOBJECT:")))(Setqb(Entgetnm))(Setqold(Assoc6b))(If(=old'NIL)(Setqb(Cons(Cons6lt)b))(Setqb(subst(Cons6lt)oldb)))(Entmodb));;;5将目标变为当前层的颜色。(Defunc:LX5(/a)
6、(Setqb(Getvar"CLAYER"))(Setqa(Entget(Car(Entsel"PicktheSOURCEOBJECT"))))(Setqa(Subst(cons8b)(assoc8a)a))(Entmoda));;;6将目标2层变为目标1层。(Defunc:LX6(/a)(Setqa(Entget(Car(Entsel"PicktheTARGET1OBJECT"))))(Setqc(Entget(Car(Entsel"PicktheTARGET2OBJECT"))))(Setqb(Cdr(Assoc8c)))(Setqa(Subst(C
7、ons8b)(Assoc8a)a))(Entmoda));;;7将指定对象所在的图层变为当前层。(Defunc:LX7(/a)(setqa(Entget(Car(entsel"PicktheSOURCEOBJECT"))))(Setqb(Cdr(Assoc8a)))(Command"Layer""s"b""))(Defunc:LX7(/ab)(setqa(getpoint"inputpoint:"))(setqa(Entget(Entlast)))(Setqb(Entget(Car(Entsel"PicktheTARGET1OBJECT"))))(S
此文档下载收益归作者所有