乐筑天下

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

[编程交流] can't get coordinates str

[复制链接]

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 22:52:38 | 显示全部楼层
 

 
 
 
 
Agreed.
 
 
 
 
If XAngle == 45 degrees (1/4 Pi), then subtracting it from 1/2 Pi, yields 1/4 Pi... However, adding 1/2 Pi, yields 3/4 Pi.
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 22:54:00 | 显示全部楼层
 
And the maximum angle from the Y-axis is 1/2 Pi (90°) .
 
All we need now is a response from the OP.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 23:02:09 | 显示全部楼层
 
We're deriving YAngle from XAngle, and not deriving XAngle from YAngle (as there is no built-in Method for YAngle), thus one must add 1/2 Pi to XAngle.
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 23:03:00 | 显示全部楼层
 
Absolutely correct
But am I missing something here, if we are deriving the angle of the line from the Y-axis it can not be greater than 1/2 Pi (90°) and by adding 1/2 Pi to the XAngle will always give a value of greater than 90°, because 1/2 Pi is 90°
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 23:11:04 | 显示全部楼层
 
As I understand it, the OP merely requested YAngle, given the equivalent of Point2d (X, Y) for start and end points, thus simply calculating the (X)Angle of start-->end allows us to add 1/2 Pi to yield YAngle, regardless of its orientation, or quadrant.
 
Generally, AutoCAD will automagically subtract 2*Pi in the event the returned Vector2D is greater at input (i.e., at Command Line, etc.), but even that could be a simple evaluation within the Method/Function being coded here.
 
Visual LISP Example:
 
  1. (vla-put-rotation  (+ (* 0.5 pi) (* 2 pi)))
 
 
 
Now, should the OP be intending for the resultant YAngle being calculated to always be 'plan readable' that has not yet been requested, so based on the information given thus far, the aforementioned is the best, and simplest I can come up with, regardless of API being used.
 
Cheers
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 11:18 , Processed in 0.793199 second(s), 60 queries .

© 2020-2025 乐筑天下

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