我编写了一个AutoCAD脚本,用来绘制两条独立的、空间分离的三维多段线。然而,在执行脚本之后,我得到了多段线之间的一致性。有趣的是,脚本的两次连续运行可能会产生不同的连接。
AutoCAD脚本对空格非常挑剔,因为它们有时被解释为命令终止指示符。在下面的脚本中,行的末尾没有空格。但是,文件末尾有一行空白。
3dpoly 396.958912852,30.8766759787,27.6970084442
392.314112161,78.0361288065,27.6970084442
383.307717991,107.726231443,27.6970084442
369.551813005,153.073372946,27.6970084442
354.926222488,180.435928247,27.6970084442
332.587844921,222.228093208,27.6970084442
312.905111301,246.211573517,27.6970084442
282.842712475,282.842712475,27.6970084442
258.859232165,302.525446095,27.6970084442
222.228093208,332.587844921,27.6970084442
194.865537907,347.213435437,27.6970084442
153.073372946,369.551813005,27.6970084442
123.383270309,378.558207175,27.6970084442
78.0361288065,392.314112161,27.6970084442
47.1594528278,395.355199309,27.6970084442
0.0,400.0,27.6970084442
-47.1594528278,395.355199309,27.6970084442
-78.0361288065,392.314112161,27.6970084442
-123.383270309,378.558207175,27.6970084442
-153.073372946,369.551813005,27.6970084442
-194.865537907,347.213435437,27.6970084442
-222.228093208,332.587844921,27.6970084442
-258.859232165,302.525446095,27.6970084442
-282.842712475,282.842712475,27.6970084442
-312.905111301,246.211573517,27.6970084442
-332.587844921,222.228093208,27.6970084442
-354.926222488,180.435928247,27.6970084442
-369.551813005,153.073372946,27.6970084442
-383.307717991,107.726231443,27.6970084442
-392.314112161,78.0361288065,27.6970084442
-396.958912852,30.8766759787,27.6970084442
-400.0,0.0,27.6970084442
-396.958912852,-30.8766759787,27.6970084442
-392.314112161,-78.0361288065,27.6970084442
-383.307717991,-107.726231443,27.6970084442
-369.551813005,-153.073372946,27.6970084442
-354.926222488,-180.435928247,27.6970084442
-332.587844921,-222.228093208,27.6970084442
-312.905111301,-246.211573517,27.6970084442
-282.842712475,-282.842712475,27.6970084442
-258.859232165,-302.525446095,27.6970084442
-222.228093208,-332.587844921,27.6970084442
-194.865537907,-347.213435437,27.6970084442
-153.073372946,-369.551813005,27.6970084442
-123.383270309,-378.558207175,27.6970084442
-78.0361288065,-392.314112161,27.6970084442
-47.1594528278,-395.355199309,27.6970084442
0.0,-400.0,27.6970084442
47.1594528278,-395.355199309,27.6970084442
78.0361288065,-392.314112161,27.6970084442
123.383270309,-378.558207175,27.6970084442
153.073372946,-369.551813005,27.6970084442
194.865537907,-347.213435437,27.6970084442
222.228093208,-332.587844921,27.6970084442
258.859232165,-302.525446095,27.6970084442
282.842712475,-282.842712475,27.6970084442
312.905111301,-246.211573517,27.6970084442
332.587844921,-222.228093208,27.6970084442
354.926222488,-180.435928247,27.6970084442
369.551813005,-153.073372946,27.6970084442
383.307717991,-107.726231443,27.6970084442
392.314112161,-78.0361288065,27.6970084442
396.958912852,-30.8766759787,27.6970084442
400.0,0.0,27.6970084442
396.958912852,30.8766759787,27.6970084442
3dpoly 392.314112161,78.0361288065,-27.6970084442
396.958912852,30.8766759787,-27.6970084442
400.0,0.0,-27.6970084442
396.958912852,-30.8766759787,-27.6970084442
392.314112161,-78.0361288065,-27.6970084442
383.307717991,-107.726231443,-27.6970084442
369.551813005,-153.073372946,-27.6970084442
354.926222488,-180.435928247,-27.6970084442
332.587844921,-222.228093208,-27.6970084442
312.905111301,-246.211573517,-27.6970084442
282.842712475,-282.842712475,-27.6970084442
258.859232165,-302.525446095,-27.6970084442
222.228093208,-332.587844921,-27.6970084442
194.865537907,-347.213435437,-27.6970084442
153.073372946,-369.551813005,-27.6970084442
123.383270309,-378.558207175,-27.6970084442
78.0361288065,-392.314112161,-27.6970084442
47.1594528278,-395.355199309,-27.6970084442
0.0,-400.0,-27.6970084442
-47.1594528278,-395.355199309,-27.6970084442
-78.0361288065,-392.314112161,-27.6970084442
-123.383270309,-378.558207175,-27.6970084442
-153.073372946,-369.551813005,-27.6970084442
-194.865537907,-347.213435437,-27.6970084442
-222.228093208,-332.587844921,-27.6970084442
-258.859232165,-302.525446095,-27.6970084442
-282.842712475,-282.842712475,-27.6970084442
-312.905111301,-246.211573517,-27.6970084442
-332.587844921,-222.228093208,-27.6970084442
-354.926222488,-180.435928247,-27.6970084442
-369.551813005,-153.073372946,-27.6970084442
-383.307717991,-107.726231443,-27.6970084442
-392.314112161,-78.0361288065,-27.6970084442
-396.958912852,-30.8766759787,-27.6970084442
-400.0,0.0,-27.6970084442
-396.958912852,30.8766759787,-27.6970084442
-392.314112161,78.0361288065,-27.6970084442
-383.307717991,107.726231443,-27.6970084442
-369.551813005,153.073372946,-27.6970084442
-354.926222488,180.435928247,-27.6970084442
-332.587844921,222.228093208,-27.6970084442
-312.905111301,246.211573517,-27.6970084442
-282.842712475,282.842712475,-27.6970084442
-258.859232165,302.525446095,-27.6970084442
-222.228093208,332.587844921,-27.6970084442
-194.865537907,347.213435437,-27.6970084442
-153.073372946,369.551813005,-27.6970084442
-123.383270309,378.558207175,-27.6970084442
-78.0361288065,392.314112161,-27.6970084442
-47.1594528278,395.355199309,-27.6970084442
0.0,400.0,-27.6970084442
47.1594528278,395.355199309,-27.6970084442
78.0361288065,392.314112161,-27.6970084442
123.383270309,378.558207175,-27.6970084442
153.073372946,369.551813005,-27.6970084442
194.865537907,347.213435437,-27.6970084442
222.228093208,332.587844921,-27.6970084442
258.859232165,302.525446095,-27.6970084442
282.842712475,282.842712475,-27.6970084442
312.905111301,246.211573517,-27.6970084442
332.587844921,222.228093208,-27.6970084442
354.926222488,180.435928247,-27.6970084442
369.551813005,153.073372946,-27.6970084442
383.307717991,107.726231443,-27.6970084442
392.314112161,78.0361288065,-27.6970084442
经过一番研究,我发现如果启用对象捕捉功能,AutoCAD显然会在脚本执行过程中捕捉。如果该功能已关闭,则一切正常。