无
This commit is contained in:
1 parent
5289689737
commit
1fdcdefef1
3 files changed
+36
-4
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import socket
|
||||
import json
|
||||
|
||||
# 模拟大模型生成的 JSON 指令
|
||||
command = {
|
||||
"cmd": "draw_circle",
|
||||
"x": 500.0,
|
||||
"y": 500.0,
|
||||
"r": 250.0
|
||||
}
|
||||
|
||||
try:
|
||||
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
client.connect(("127.0.0.1", 8080))
|
||||
# 发送序列化后的 JSON 字符串
|
||||
client.sendall(json.dumps(command).encode('utf-8'))
|
||||
client.close()
|
||||
print("指令发送成功,请查看 AutoCAD 屏幕。")
|
||||
except Exception as e:
|
||||
print(f"连接失败: {e}")
|
||||
Reference in new issue
Block a user