乐筑天下

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

[编程交流] Points to a Z-height based on

[复制链接]

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 09:16:38 | 显示全部楼层 |阅读模式
I seem to remember that there have been routines posted here that can create Points with a Z-value based on Text-objects - but I can't seem to find it! Anyone remember the same thing? Anyone have any better luck at finding it?
 
To clairfy a bit more what I am after: I get files from landscapers with new road layouts and such and they are schock-full with Z-heights, all typed out in MText. The files themselves have no Z-values on any objects. I want to take these Z-heights and get a point set at the insertion point of the Text, at the Z-height that the Text says. Makes sense?
 
Like I said, I am not asking for a routine like that - I am just so sure that I have seen it somewhere so I am asking for help with the Search.
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 09:25:09 | 显示全部楼层
Have you tried Lee Mac's site? I've seen one somewhere out there.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:29:36 | 显示全部楼层
Hi Tiger,
 
Maybe something like this?
 
  1. (defun c:test ( / en i pt ss zv ) (if (setq ss (ssget '((0 . "TEXT,MTEXT"))))   (repeat (setq i (sslength ss))     (setq en (entget (ssname ss (setq i (1- i)))))     (if       (and (eq "TEXT" (cdr (assoc 0 en)))         (or           (< 0 (cdr (assoc 72 en)))           (< 0 (cdr (assoc 73 en)))         )       )       (setq pt (cdr (assoc 11 en)))       (setq pt (cdr (assoc 10 en)))     )     (if (setq zv (distof (cdr (assoc 1 en))))       (entmakex         (list           (cons 0 "POINT")           (list 10 (car pt) (cadr pt) zv)         )       )     )   ) ) (princ))
 
It will work for Text/MText with any alignment. It will use your current settings for CLAYER/CECOLOR/CELTYPE/THICKNESS etc, however, the code could be altered to match these settings for the selected Text items.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:31:19 | 显示全部楼层
 
Thanks for the plug Tyke
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 09:35:46 | 显示全部楼层
aww Lee
 
I will take a look at it tomorrow - off for an work event (with beer) now
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:41:53 | 显示全部楼层
 
Nice!  ...
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 09:47:19 | 显示全部楼层
 
Don't mention it Lee :wink:
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 09:52:24 | 显示全部楼层
Awesome Lee! Thanks a million!
 
The work-event (with beer) was an outing with my little part of the company into the woods for a High-rope course. We climbing about 15meters up a tree and "walked" across lines, poles, wires, ladder-esque things to the next tree - and the next tree - and the next... my arms hurt today I might add.
 
But I did get beer in the end
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 09:57:17 | 显示全部楼层
 
Some people have all the luck :wink: and others have to work.
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 09:58:15 | 显示全部楼层
 
All work and no play makes Tyke a sad Yorkshire :wink:
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 02:56 , Processed in 0.336105 second(s), 72 queries .

© 2020-2025 乐筑天下

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