乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 55|回复: 3

[编程交流] error: bad argument type: 2D/3

[复制链接]

3

主题

7

帖子

4

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 23:15:59 | 显示全部楼层 |阅读模式
Here is the code, and i tried commenting it so it is easy to follow, in a nutshell all this is doing is creating a circle, hatching it with the color red, and making a line from the center upwards and making it red..
 
Now it runs all of this perfectly smoothly.. but when i copy and paste the exact code block that generates the line going up and just change some variables so that the line goes down.. it gives me the error in my title.. what gives??
 
  1. ((= choice 2)(setq gas_redo 0)(setq gas_another 0)(while (/= gas_redo 1)        (prompt "\nYou have chosen Gas")        (setq pg_cpo1 (getpoint "\nPick well location"))        (setq pg_cpo2 (polar pg_cpo1 (dtr 90.0) edge))                                (command "circle" "2p" pg_cpo1 pg_cpo2)                        ;draw circle                                                (setq pg_hw (polar pg_cpo1 (dtr 90.0) (/ edge 2)))        (command "-hatch" pg_hw "P" "S" "CO" "T" "255,0,0" "" ""); hatch the circle with COLOR_RED                                        (setq pg_NL1 (polar pg_cpo1 (dtr 90.0) edge))                ;set points for north line        (setq pg_NL2 (polar pg_NL1 (dtr 90.0) (/ edge 2)))        ; "     "        (command "line" pg_NL1 pg_NL2 "")                        ; drew line north of circle        (command "change" pg_NL2 "" "P" "CO" "T" "255,0,0" ""); changed the line color to red                                        (setq pg_SL1 (polar pg_cpo1 (dtr 270.0) edge))                ;IT DOESN"T LIKE THIS CODE BLOCK        (setq pg_SL2 (polar pg_SL2 (dtr 270.0) (/ edge 2)))        (command "line" pg_SL1 pg_SL2 "")        (command "change" pg_SL2 "" "P" "CO" "T" "255,0,0" "")                                        (setq gas_another(getint "\nCreate another? (1)YES or (2)NO"))        (if (= gas_another 2) (setq gas_redo 1) (prompt"\nDrawing another Gas Well.."))))
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-5 23:36:05 | 显示全部楼层
At a glance, seems that pg_NL2 variable is holding a point, not a line entity:
  1. (command "line" pg_NL1 pg_NL2 "")     ; drew line north of circle(command "change" [color=red][s]pg_NL2[/s][/color] [color=red](entlast)[/color] "" "P" "CO" "T" "255,0,0" "")
Same here:
  1. (command "line" pg_SL1 pg_SL2 "")(command "change" [color=red][s]pg_SL2[/s][/color] [color=red](entlast)[/color] "" "P" "CO" "T" "255,0,0" "")
 
 
 
As for locating the source of that error, I suggest you to check Lee Mac's tutorial on debugging, since to locate the issue will need to review the entire code, not just an excerpt.
回复

使用道具 举报

3

主题

7

帖子

4

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 23:56:05 | 显示全部楼层
 
 
Thankyou MSasu,
 
I will go that link and give it a shot, well i know that the pg_LN1 isn't a line entity, but all i am doing is replicating the change command as if i was doing it on an empty project, and where it asks for selecting objects, normally you would click on the line, but isn't clicking just choosing coordinates, so i used that variable as a coordinate because I know it will fall on the line, therefore selecting it.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:26:31 | 显示全部楼层
Another suggestion like Msasu
 
  1. (command "-hatch" pg_hw ........(command "-hatch" (entlast) .........;hatches circle as last entity
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 00:21 , Processed in 0.591976 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表