JSYoung81 发表于 2022-7-5 22:37:19

管道起点和终点

需要一些帮助。我试图获取管道的起点/终点,我可以获取vla对象信息,但我做不到,从中拉出NEZ。
 
(setq endpoint(vlax-get-property item 'EndPoint))
 
任何和所有的帮助都将是伟大的!

BIGAL 发表于 2022-7-5 22:47:21

将vl pt转换为正常pt
 

(setq pointl (vlax-safearray->list (vlax-variant-value endpoint)) )
(setq x (car point1))
(setq y (cadr point1))
(setq z (caddr point1))

Tharwat 发表于 2022-7-5 22:49:41

我的提议。
 

(mapcar 'set '(x y z) (vlax-get item 'endpoint))

hanhphuc 发表于 2022-7-5 22:59:56

vlax get很有趣,但为什么不在2007年的开发文档中呢?
 
所以,我试着递归&它奏效了
(vlax put项的端点(列表x y x))
它比(vla put endpoint item(vlax-3d-point(list x y x))简单)
 
非常感谢。

Tharwat 发表于 2022-7-5 23:05:42

 
不过,它甚至没有出现在任何最新版本中。
 
 
不客气。

BIGAL 发表于 2022-7-5 23:08:19

观看X Y Z

hanhphuc 发表于 2022-7-5 23:17:54

哎呀。。打字错误
(列表x y x)-->(列表x y z)
谢谢你,比尔。祝你今天愉快

Hippe013 发表于 2022-7-5 23:22:59

我相信OP正在尝试使用AECCIPE对象。以上方法适用于直线、圆弧等。但遗憾的是,它们不适用于AECCIPE对象。
 
线的起点和终点是#,它与vlax get和vlax put一起工作。
 
另一方面,AECCIPE的起点和终点是#。
 
我能够检索AECCIPE的起点和终点的唯一方法是使用以下代码:
 
(setq p0 (vlax-safearray->list (vlax-variant-value (vlax-get-property pipe 'PointAtParam 0)))) ;For the startpoint
(setq p1 (vlax-safearray->list (vlax-variant-value (vlax-get-property pipe 'PointAtParam 1)))) ;For the endpoint
 
要设置起点和终点的值,请使用:
 
(vlax-invoke-method pipe 'SetStartAndEndPoints (vlax-3d-point p0)(vlax-3d-point p1))
 
(p0和p1的值当然是XYZ的列表。)
 
请注意,起点和终点是管道的中心。要获得管道的反向高程,需要检索InnerDiameterWidth属性并进行一些数学计算。
 
当做
 
hippe013

Tharwat 发表于 2022-7-5 23:27:54

 
你好
 
难道这根本不会被使用并且比那更简单吗?
 

(vlax-curve-getpointatparam pipe 0)
(vlax-curve-getpointatparam pipe 1)

 
或者以此作为起点和终点的列表。
 

(mapcar '(lambda (i) (vlax-curve-getpointatparam pipe i)) '(0 1))

Hippe013 发表于 2022-7-5 23:37:21

vlax curve getPointAtParam用于AECCIPE对象时,返回零作为参数时的点(0 0 0),以及一作为参数时的点(0 0 1)。
页: [1] 2
查看完整版本: 管道起点和终点