我正在使用AutoCAD Civil 3D 2018并具有一个.scr文件,该文件仅绘制了几行(从excel文件生成),但是当我将.scr拖到图形上时,发现结果不一致。 50%的时间符合我的预期,其余时间某些行未显示或结束坐标不正确。
-color Green pline 603913.8394,7570974.6134 w 15 15 603950.7455,7570959.1881
-color Green pline 603950.7455,7570959.1881 w 15 15 603996.8782,7570939.9065
-color Green pline 603996.8782,7570939.9065 w 15 15 604053.2915,7570916.3279
-color Red pline 604053.2915,7570916.3279 w 15 15 604127.3464,7570885.3759
-color Green pline 604127.3464,7570885.3759 w 15 15 604187.2909,7570860.326
-color Green pline 604187.2909,7570860.326 w 15 15 604240.7861,7570837.9671
-color Green pline 604240.7861,7570837.9671 w 15 15 604277.6908,7570822.5379
-color Green pline 604277.6908,7570822.5379 w 15 15 604314.5966,7570807.1127
-color Green pline 604314.5966,7570807.1127 w 15 15 604388.4088,7570776.2621
-color Green pline 604388.4088,7570776.2621 w 15 15 604473.0531,7570740.8841
-color Green pline 604473.0531,7570740.8841 w 15 15 604532.7468,7570715.9345
-color Green pline 604532.7468,7570715.9345 w 15 15 604582.6623,7570695.0718
-color Green pline 604582.6623,7570695.0718 w 15 15 604661.0878,7570662.293
-color Green pline 604661.0878,7570662.293 w 15 15 604737.4495,7570630.3768
-color Green pline 604737.4495,7570630.3768 w 15 15 604817.9439,7570596.7333
-color Green pline 604817.9439,7570596.7333 w 15 15 604881.4611,7570570.1856
-color Green pline 604881.4611,7570570.1856 w 15 15 604934.0745,7570548.1953
-color Green pline 604934.0745,7570548.1953 w 15 15 605009.7191,7570516.5788
-color Green pline 605009.7191,7570516.5788 w 15 15 605085.3766,7570484.9569
-color Green pline 605085.3766,7570484.9569 w 15 15 605166.7307,7570450.9541
-color Green pline 605166.7307,7570450.9541 w 15 15 605231.2105,7570424.0041
-color Green pline 605231.2105,7570424.0041 w 15 15 605326.3627,7570384.2342
-color Green pline 605326.3627,7570384.2342 w 15 15 605435.2625,7570338.7184
-color Green pline 604227.1343,7570805.3043 w 15 15 604264.039,7570789.8751
-color Green pline 605217.5588,7570391.3413 w 15 15 605312.711,7570351.5714
-color Green pline 604213.4829,7570772.6424 w 15 15 604250.3876,7570757.2132
-color Green pline 605203.9074,7570358.6794 w 15 15 605299.0596,7570318.9095
-color Green pline 603872.8853,7570876.6277 w 15 15 603909.7914,7570861.2024
-color Green pline 604199.8319,7570739.9814 w 15 15 604236.7366,7570724.5522
-color Green pline 605190.2564,7570326.0184 w 15 15 605285.4085,7570286.2485
-color Green pline 604186.1789,7570707.3157 w 15 15 604223.0852,7570691.8903
-color Green pline 605176.605,7570293.3565 w 15 15 605271.7571,7570253.5866
-color Green pline 604172.5291,7570674.6576 w 15 15 604209.4338,7570659.2284
-color Green pline 604209.4338,7570659.2284 w 15 15 604246.3397,7570643.8032
-color Green pline 604246.3397,7570643.8032 w 15 15 604320.1519,7570612.9526
-color Green pline 604320.1519,7570612.9526 w 15 15 604374.6873,7570590.1589
-color Green pline 604374.6873,7570590.1589 w 15 15 604464.4899,7570552.625
-color Green pline 604464.4899,7570552.625 w 15 15 604514.4054,7570531.7623
-color Green pline 604514.4054,7570531.7623 w 15 15 604592.8308,7570498.9835
-color Green pline 604592.8308,7570498.9835 w 15 15 604669.1925,7570467.0673
-color Green pline 604669.1925,7570467.0673 w 15 15 604719.8881,7570445.8786
-color Green pline 604719.8881,7570445.8786 w 15 15 604813.2041,7570406.8761
-color Green pline 604813.2041,7570406.8761 w 15 15 604865.8176,7570384.8858
-color Green pline 604865.8176,7570384.8858 w 15 15 604941.4621,7570353.2693
-color Green pline 604941.4621,7570353.2693 w 15 15 605017.1196,7570321.6475
-color Green pline 605017.1196,7570321.6475 w 15 15 605068.3974,7570300.2154
-color Green pline 605068.3974,7570300.2154 w 15 15 605162.9536,7570260.6946
-color Green pline 605162.9536,7570260.6946 w 15 15 605258.1058,7570220.9247
-color Green pline 604209.434,7570659.228 w 15 15 604277.691,7570822.538
-color Green pline 604161.6941,7570651.3272 w 15 15 604199.5231,7570635.5162
-color Green pline 604941.462,7570353.269 w 15 15 605009.719,7570516.579
-color Green pline 603784.0512,7571028.8598 w 15 15 603890.9216,7571194.1743
-color Green pline 603841.2898,7571004.9363 w 15 15 603912.7505,7571117.3467
-color Green pline 603913.8394,7570974.6134 w 15 15 603920.4434,7571055.513 603886.7386,7571077.4224
-color Cyan pline 603912.7505,7571117.3467 w 15 15 603998.5629,7571061.5656
-color Green pline 604250.473,7570960.456 w 15 15 604341.582,7570912.882 604381.387,7570973.875
-color Red pline 604815.842,7570771.62 w 15 15 604778.78,7570715.084 604860.437,7570661.554
-color Green pline 604778.78,7570715.084 w 15 15 604737.449,7570630.377
-color Green pline 605164.047,7570626.375 w 15 15 605126.893,7570569.902 605209.313,7570515.678 605126.893,7570569.902 605090.261,7570496.644
-color Green pline 605514.134,7570480.162 w 15 15 605476.879,7570423.755 605559.574,7570369.136 605476.879,7570423.755 605440.34,7570350.867
-color Green pline 604127.346,7570885.376 w 15 15 604169.314,7570950.713
-color Cyan pline 605681.391,7573276.081 w 15 15 605764.108,7573402.828
-color Green pline 604881.4611,7570570.1856 w 15 15 604982.8368,7570727.6401
-color Green pline 604817.9439,7570596.7333 w 15 15 604928.3409,7570763.4931
-color Green pline 605098.346,7571023.828 w 15 15 605163.984,7571123.319
-color Green pline 605301.045,7571332.397 w 15 15 605369.575,7571436.936
-color Green pline 605506.637,7571646.015 w 15 15 605575.168,7571750.554
-color Green pline 605713.380,7571958.331 w 15 15 605781.409,7572065.184
-color Green pline 605917.8476,7572273.2909 w 15 15 605978.1289,7572365.2462
-color Green pline 606123.4142,7572586.8699 w 15 15 606191.945,7572691.4093
-color Green pline 606329.0066,7572900.4882 w 15 15 606397.5374,7573005.0277
-color Green pline 606754.5613,7573549.1972 w 15 15 606815.1891,7573642.1293
-color Green pline 606952.9974,7573852.3472 w 15 15 607021.5283,7573956.8868
-color Green pline 607158.59,7574165.9659 w 15 15 607227.1209,7574270.5055
-color Green pline 605231.2105,7570424.0041 w 15 15 605329.3108,7570575.9192
-color Cyan pline 605583.2721,7570960.4254 w 15 15 605652.2076,7571064.7961
-color Green pline 605166.7307,7570450.9541 w 15 15 605277.8033,7570618.2776
-color Green pline 605277.8033,7570618.2776 w 15 15 605376.2123,7570768.0893
-color Green pline 605376.2123,7570768.0893 w 15 15 605444.9153,7570872.5168
-color Green pline 605444.9153,7570872.5168 w 15 15 605513.6178,7570976.9436
-color Green pline 605513.6178,7570976.9436 w 15 15 605582.3199,7571081.3697
-color Green pline 605582.3199,7571081.3697 w 15 15 605664.5694,7571206.3877
-color Green pline 605664.5694,7571206.3877 w 15 15 605719.725,7571290.2233
-color Green pline 605719.725,7571290.2233 w 15 15 605788.428,7571394.6509
-color Green pline 605788.428,7571394.6509 w 15 15 605857.13,7571499.0769
-color Green pline 605857.13,7571499.0769 w 15 15 605925.8331,7571603.5045
-color Green pline 605925.8331,7571603.5045 w 15 15 605993.3653,7571706.1524
-color Green pline 605993.3653,7571706.1524 w 15 15 606063.2382,7571812.3582
-color Green pline 606063.2382,7571812.3582 w 15 15 606131.9402,7571916.7841
-color Green pline 606131.9402,7571916.7841 w 15 15 606200.6433,7572021.2118
-color Green pline 606200.6433,7572021.2118 w 15 15 606269.3452,7572125.6377
-color Green pline 606269.3452,7572125.6377 w 15 15 606352.0457,7572251.3412
我已经附上了两张图像,显示了我所看到的差异,第一张图像是我所期望的,第二张图像显示了在未正确导入时的外观。
我可以将其拖动到一个空的图形中,有时它会正确显示。如果然后删除这些行并再次将.scr文件拖入,它将始终显示不正确。
起初我虽然是因为在行尾有一些错误的空格,但并没有出现。
有人可以帮助我了解这里发生的事情吗?
李
答案 0 :(得分:1)
通过AutoCAD脚本(.scr
)或AutoLISP程序(.lsp
)向命令提示符提供点时,这些点将受评估时激活的任何对象捕捉模式的影响。
有三种方法可以避免这种情况:
在运行脚本之前完全禁用对象捕捉(通过切换 F3 [从而切换16384
系统变量的OSMODE
位]或存储当前OSMODE
系统变量的值,然后将其设置为0
)。
使用“对象捕捉”修改器_none
或_non
来开始输入点,指示AutoCAD忽略提供的下一个点的任何活动的“对象捕捉”模式,例如:
-color Green pline _non 603913.8394,7570974.6134 w 15 15 _non 603950.7455,7570959.1881
将OSNAPCOORD
系统变量设置为1
。
此系统变量确定在命令行输入的坐标是否会受到活动对象捕捉模式的影响:
0 Running object snap settings override keyboard coordinate entry
1 Keyboard entry overrides object snap settings
2 Keyboard entry overrides object snap settings except in scripts