乐筑天下

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

[编程交流] Create & Insert block - by gr

[复制链接]

6

主题

8

帖子

2

银币

初来乍到

Rank: 1

铜币
30
发表于 2022-7-5 23:38:56 | 显示全部楼层 |阅读模式
I have a drawing that contains a map area to XY coordinates (MAP.dwg)
 
I am trying to create a lisp that will create & insert a block by grabbing element info from the MAP.dwg area (using user input) to XY co-ordinates
 
The lisp would need to open the MAP.dwg, copy elements from specified user XY co-ords, then insert as a block into the current drawing. I want the inserted block to be a consistent sized square.
 
Can anyone help or has anyone done something similar?
回复

使用道具 举报

9

主题

49

帖子

41

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 00:06:49 | 显示全部楼层
How far you're with the lisp?
回复

使用道具 举报

6

主题

8

帖子

2

银币

初来乍到

Rank: 1

铜币
30
发表于 2022-7-6 00:22:18 | 显示全部楼层
I am currently using the below multiple lisps, one at a time, but want to automate it into one click.
 
 
  1. \\INSERTS UKMAP(defun C:insert_railmapuk ( )(command "insunits" "4")         (command "osmode" "0" )(command "-layer" "set" "0" "")(command "-insert" "*UK" "0,0" "1" "0")(princ))\\INSERTS RAIL LOCATION MAP BOX(defun C:INSERTZZMAP ( ) (command "INSUNITS" "4")(command "-insert" "*scalemapmodel" pause "1" "0")(princ))\\CREATES MAP BLOCK(defun C:CREATEZZMAP ( )(command "-BLOCK" "MAP" "Y" pause)(princ))\\DELETES UKMAP IGNORES MAP BLOCK(defun c:DELZZMAP (/ ss i sset e) (if   (setq ss (ssget "_x" '((8 . "_ACM-BLCK-UKMAP-LANDLINE,_ACM-BLCK-UKMAP-RAIL,_ACM-BLCK-UKMAP-STATION,_ACM-BLCK-UKMAP-STATION NAME"))))   (repeat     (setq i (sslength ss))     (setq sset (ssname ss (setq i (1- i))))     (setq e (entget sset))     (if (not (eq (cdr (assoc 2 e))"MAP"))       (entdel sset)     )   )   (princ) ) (princ))\\SCALES MAP BLOCK IN PAPER SPACE(defun C:SCALEZZMAP ( ) (sssetfirst nil (ssget "_x" '((0 . "INSERT")(2 . "MAP"))))(command "SCALE" "p" "" "1059,397.2416" "0.01")(princ))\\INSERTS RED DOT(defun C:LOCATEZZMAP ( )   (command "insunits" "4")            (command "osmode" "0" )   (command "-layer" "set" "0" "")   (command "-insert" "*reddot" pause "1" "0")   (princ))
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:45:11 | 显示全部楼层
If you look into writing a script its pretty do able, just open master dwg it writes the xy to a txt file open second dwg via script block is inserted, you can do stuff like jump between dwgs code is it a bit more complex. A script can run multiple lisps one after each other.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 00:39 , Processed in 0.479332 second(s), 60 queries .

© 2020-2025 乐筑天下

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