乐筑天下

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

[编程交流] Help! Call Lisp vlax-curve-get

[复制链接]

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 21:47:08 | 显示全部楼层 |阅读模式
Hello Anybody Help.
 
 
I need to get point from spline with use lisp function in autocad vba
 
vlax-curve-getPointAtDist
 
 
Could somebody can help me?
 
 
 
 
Best Regard
Joe
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 22:01:22 | 显示全部楼层
I write this function but still error on get variable form lisp
 
anybody help!
 
 
 
  1. Function GetPointSpline(oEnt As AcadEntity, distance As Double) As VariantDim sVar As VariantDim strCom As StringDim USERR1 As Variant'sVar = ""' Call Get Point in spline distance 1.5 from begin pointWith ThisDrawing   .SetVariable "USERR1", 1   .SendCommand "(vl-load-com)" & vbCr     strCom = "(setvar " & Chr(34) & "USERR1" & Chr(34) &  Chr(32) & "(vlax-curve-getPointAtDist  (vlax-ename->vla-object  (handent " & Chr(34) & oEnt.Handle & Chr(34) & " )  )"  & " 1.5))" & vbCr   .SendCommand strCom   GetPointSpline = .GetVariable("USERR1")End WithEnd Function
 
 
Result:
 
; error: AutoCAD variable setting rejected: "USERR1" (-5.97251 -11.4573 0.0)
 
 
 
++++++++++++++++++
How can i get variable value "USERR1" (-5.97251 -11.4573 0.0) in autocad vba?
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 22:17:05 | 显示全部楼层
You can not save to USERRx as its a real expects a single number you can save to users1 a string, I would run the lisp as a library function just load and run then get the returned point convert to a VBA variable trying to find example. This way could have a library of the vlax curve stuff.
 
Almost forgot, you need to rewrite the code
  1. ; pt=(-5.97251 -11.4573 0.0)(setq ans (strcat (rtos (car pt) 2 2) " " (rtos (cadr pt) 2 2) "" (rtos (caddr pt) 2 2)))
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 22:30:56 | 显示全部楼层
  1. SendCommand "(vl-load-com)" & vbCr     strCom = "(setvar " & Chr(34) & "USERR1" & Chr(34)  &  Chr(32) & "(vlax-curve-getPointAtDist   (vlax-ename->vla-object  (handent " & Chr(34) & oEnt.Handle  & Chr(34) & " )  )"  & " 1.5))" & vbCr   .SendCommand strCom   GetPointSpline = .GetVariable("USERR1")
 
 
I just know a little bit lisp code , So How to I get value return string from .Sendcommand strCom.
 
 
 
Thank you.BIGAL
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 22:45:01 | 显示全部楼层
Start by breaking down into a 2 step process
Not tested
  1. strCom = "(setvar " & Chr(34) & "USERS1" & Chr(34) & Chr(32) & vbCr)".SendCommand strComstrcom "(setq pt (vlax-curve-getPointAtDist (vlax-ename->vla-object (handent " & Chr(34) & oEnt.Handle & Chr(34) & " ) )" & " 1.5)))" & vbCr.SendCommand strCom
回复

使用道具 举报

4

主题

2143

帖子

2197

银币

限制会员

铜币
-24
发表于 2022-7-6 22:51:20 | 显示全部楼层
Please read the Code Posting Guidelines and have your Code to be included in Code Tags.[NOPARSE]
  1. Your Code Here[/NOPARSE]
=
  1. Your Code Here
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 14:55 , Processed in 0.386855 second(s), 64 queries .

© 2020-2025 乐筑天下

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