newer 发表于 2014-12-20 12:32:19

通过ActiveX构造LWPolyline

Constructing vlisp lwpolyline via ActiveX

Issue
Is the method of passing a list of points from ActiveX to addLWPolyline in
AutoCAD 2000 that same way as in AutoCAD R14 using Visual LISP?

The following error occurs when passing a list:
Error: lisp value has no coercion to VARIANT with this type:
(17509.1 11009.0 17484.1 11009.0 17484.1 11109.0 17509.1 11109.0)

Solution
The passing of lists to ActiveX methods has changed in AutoCAD 2000. You need to
use the vlax-make-safearray, vlax-safearray-fill, vlax-make-variant functions to
pass a list to ActiveX functions. The following code does this:

**** Hidden Message *****

wzg356 发表于 2014-12-20 12:52:34

只有一个字:顶顶顶顶

819534890 发表于 2014-12-20 13:46:04

很好,每天都能学到很多

/db_自贡黄明儒_ 发表于 2014-12-20 13:53:14

这个方法会不会比entmake复杂呢?

q3_2006 发表于 2014-12-21 13:15:37

也写个修改的呗...

st788796 发表于 2014-12-21 17:21:44

q3_2006 发表于 2014-12-21 13:15
也写个修改的呗...

put. coordinates

杜流浪人 发表于 2014-12-21 17:45:09

每日一码多xue

taner 发表于 2014-12-22 13:30:14

想要回复啥呢?

/db_自贡黄明儒_ 发表于 2014-12-22 13:34:43

用这种方法,好象其中有弧的也不好处理{:soso_e132:}

dnbcgrass 发表于 2014-12-27 21:24:35

回复学习一下!

Free-Lancer 发表于 2014-12-28 09:42:10

Autodesk 建议用 vla- 方式,参数用 variant ,安全类型,但是直至现在还保留的vlax-get vlax-put vlax-invoke 三个函数部分情况下可以直接使用或返回 Lisp 数据,

如 (vlax-invoke modelspace 'AddLine pt1 pt2)

(vlax-invoke ms 'AddLightWeightPolyline 2dpts)

**** Hidden Message *****

dragoon3333 发表于 2015-3-22 23:52:30

看看这个内容

海天风云 发表于 2015-3-23 10:34:23

很好,每天都能学到很多

1993063 发表于 2015-3-23 15:20:30

看看这个内容

qyming1996 发表于 2015-4-7 09:56:54

学习,学习
页: [1] 2
查看完整版本: 通过ActiveX构造LWPolyline