乐筑天下

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

[编程交流] Viewport UCS, Zoom Object

[复制链接]

11

主题

24

帖子

13

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2022-7-6 07:28:03 | 显示全部楼层 |阅读模式
I have a 'Snake' of rectangles which represent viewport views, each has its own UCS and its own layer. I am attempting to write some code which does the following;
 
  1. (defun c:sheet1 (/ SS1 )(command "setvar" "ucsfollow" "1")(setq SS1 (ssget "x" '((0 . "LINE")(8 . "SHEET1"))))(command "_.UCS" "_ENTITY" SS1)(command "_.PLAN" "")(command "_.UCS" "Named" "Save" "Sheet1"))
 
and the next one, and so on..
 
There is a problem, when I zoom 'object', it zooms to the extents of the rectangle in WCS and not the extents of the rectangle in the current UCS.
 
This should be easy, Or maybe I am going the wrong way about it....
 
Any help would be much appreciated.
 
Cheers
 
H
回复

使用道具 举报

5

主题

1334

帖子

1410

银币

限制会员

铜币
-20
发表于 2022-7-6 07:51:54 | 显示全部楼层
SS1 is selection set of LINE objects residing in layer SHEET1... So when used UCS "entity", you have to specify single entity, not a SS1... Maybe, if you only have 1 rectangle in SHEET1, you'll just need (command "_.UCS" "_Entity" (ssname SS1 0)) supplying last entity from SS1, otherwise CAD won't know on what entity should UCS have to be aligned to... Afterward, you don't need (command "_.PLAN" "") as you set variable 'UCSFOLLOW to 1, but you'll probably need to zoom it again to that particular object - rectangle - use : (command "_.ZOOM" "o" (ssname SS1 0))
 
M.R.
回复

使用道具 举报

4

主题

2143

帖子

2197

银币

限制会员

铜币
-24
发表于 2022-7-6 08:18:23 | 显示全部楼层
Please read the CODE POSTING GUIDELINES and edit your post.
回复

使用道具 举报

11

主题

24

帖子

13

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2022-7-6 08:30:50 | 显示全部楼层
Posted Edited - My apologies SLW210  
 
Marko, Thanks for your input/advice. I amended my code to suit, just playing around now to make it zoom to the extents of the object..
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 04:35 , Processed in 0.474120 second(s), 60 queries .

© 2020-2025 乐筑天下

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