乐筑天下

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

[编程交流] [Autolisp, Civil 3D] Convert s

[复制链接]

46

主题

92

帖子

45

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
235
发表于 2022-7-6 06:42:29 | 显示全部楼层 |阅读模式
Hello all.
is my first post on this forum.
I have a question on how to convert Station and offset on xy coordinates.
Differently than is shown on this page.
http://cadpanacea.com/node/187
Code of this page
  1. ; standard entity selection(setq sel (entsel "\nSelect Alignment: ")); get the entity name(setq ent (car sel)); get the entity list(setq lst (entget ent)); check to make sure the selection was the expected type(if (eq "AECC_ALIGNMENT" (cdr (assoc 0 lst))) ; if so, convert the entity into a VLA-OBJECT (setq obj (vlax-ename->vla-object ent)))(if obj (progn   ; get the name of the alignment   (setq nam (vlax-get-property obj 'Name))   ; get the start station   (setq sta1 (vlax-get-property obj 'StartingStation))   ; get the end station   (setq sta2 (vlax-get-property obj 'EndingStation))   ; set a couple of variables   (setq sta 100.0 off 10.0)   ; using the above variables, find this point on the alignment   (vlax-invoke-method obj 'PointLocation sta off 'x 'y)   ; create an AutoCAD point at this location   (entmake (list (cons 0 "POINT")(cons 10 (list x y))))   ; ask the user to pick a point   (setq pt1 (getpoint "\nSelect point: "))   ; find the station and offset for this point   (vlax-invoke-method obj 'StationOffset (car pt1) (cadr pt1) 'sta 'off)   ; inform the user   (alert (strcat           "The station is "           (rtos sta 2 2)           "\nThe offset is "           (rtos off 2 2))) ))
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:31:49 | 显示全部楼层
Are you wanting to convert Station and Offset to XY, or XY to Staion and Offset?
回复

使用道具 举报

46

主题

92

帖子

45

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
235
发表于 2022-7-6 07:52:02 | 显示全部楼层
Station and Offset to xy.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 15:13 , Processed in 0.638093 second(s), 58 queries .

© 2020-2025 乐筑天下

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