SZLMCL 发表于 2022-7-6 11:25:26

绘制带凸出的圆弧

Hy,
 
我想用AutoCAD VBA绘制一条圆弧。已知圆弧起点和终点,以及凸出值。
 
使用LWPolyline可以很容易地绘制圆弧(SetBulge),但我需要使用此绘图绘制圆弧。模型空间。AddArc命令。这里不是Setbulge函数。(Addarc需要StartAngle、ENDARGE、Radius、CenterPoint)。
 
我怎么画?
 
谢谢

Lee Mac 发表于 2022-7-6 11:45:32

可以从凸出的定义中导出必要的参数:
 

Lee Mac 发表于 2022-7-6 11:58:57

在LISP中:
 

;; BulgeData~Lee Mac
;; Args: p1,p2 Points, b Bulge
;; Returns:(<centre> <inc. angle> <radius>)

(defun BulgeData (p1 p2 b / theta/2 radius centre)
(setq theta/2 (* 2. (atan b))
       radius(/ (distance p1 p2) (* 2. (sin theta/2)))
       centre(polar p1 (+ (- (/ pi 2.) theta/2) (angle p1 p2)) radius))

(list centre (* 2. theta/2) (abs radius)))

SZLMCL 发表于 2022-7-6 12:17:54

 
谢谢,我在VBA中解决了这个问题。

Lee Mac 发表于 2022-7-6 12:26:51

很乐意帮忙
页: [1]
查看完整版本: 绘制带凸出的圆弧