200明经币....CAD关联到EXCEL...........
对应EXCEl表格
对应CAD
1:CAD图右上角有一个自编号,对应表格内的自编号,
能不能点一下右上角自编号,则将表格内对应该的地号内容
填写到相应CAD表格中
宅证对应表格
宅证对应图
2:和上面差不多,不过这份就是对应宅基地证等信息
PS:有几千份,图形大小都有不同,不过表头那几个字大小是有比例缩放的
,QQ 277046359
本帖最后由 nzl1116 于 2013-6-16 13:43 编辑
xujinhua 发表于 2013-6-1 18:31 http://bbs.mjtd.com/static/image/common/back.gif
自己顶!!!!!!!!!!!!
;;;返回指定Excel文件指定编号的一行值(defun GetExcelData (ExcFile Bianhao / ExcObj WBKs
XlsFile ActSht Range Cells return
return0 EveryRow First
)
(setq ExcObj (vlax-get-or-create-object "Excel.Application")
WBKs (vlax-get-property ExcObj 'WorkBooks)
XlsFile (vlax-invoke-method WBKs 'open ExcFile)
ActSht (vlax-get-property XlsFile 'ActiveSheet)
Range (vlax-get-property ActSht 'usedRange)
EveryRow (vlax-get-property Range 'Rows)
return nil
First nil
)
这个还要改模版,我自己写了一个改模版的,指教(defun c:ww()
(setvar "osmode" 0)
(setq chklay (tblsearch "layer" "新加表格"))
(if (= chklay nil)
(command "layer" "n" "新加表格" "c" "1" "新加表格" "")
)
(setq chklay (tblsearch "layer" "建基"))
(if (= chklay nil)
(command "layer" "n" "建基" "c" "1" "建基" "")
)
(setq chklay (tblsearch "layer" "用地"))
(if (= chklay nil)
(command "layer" "n" "用地" "c" "1" "用地" "")
)
(setq chklay (tblsearch "layer" "层数"))
(if (= chklay nil)
(command "layer" "n" "层数" "c" "1" "层数" "")
)
(setq chklay (tblsearch "layer" "结构"))
(if (= chklay nil)
(command "layer" "n" "结构" "c" "1" "结构" "")
)
(setq chklay (tblsearch "layer" "总建"))
(if (= chklay nil)
(command "layer" "n" "总建" "c" "1" "总建" "")
)
(setq lb nil lbjg nil dzlb nil)
(setq xu 0)
(setq pl (ssget(list (cons 8 "表头" ))))
(setq 数量 (sslength pl))
(repeat 数量
(setq ZD (ssname pl xu));开始字头
(setq xu (+ xu 1))
(setq 字头高 (cdr(assoc 40(entget ZD))))
(setq 比例 (/ 字头高 1.5))
(setq 字头座标 (cdr(assoc 10(entget ZD))))
(setq 左上角 (polar (polar 字头座标 pi (* 11.553 比例)) (* 1.5 pi) (* 0.8899 比例)))
(写地址)
(删除表格子程序)
(setvar "osmode" 33)
(command "insert" "新加表格xu" "s" 比例左上角 "" "" "")
(command "chprop"(entlast) """LA" "新加表格" "")
(command "explode" (entlast))
(command "explode" (entlast))
(setvar "osmode" 0)
(setq 层数 (car lb))
(setq 建基 (cadr lb))
(setq 总建 (caddr lb))
(if (= 结构 "框架")
(setq 结构1 "A")
)
(if (= 结构 "混合")
(setq 结构1 "B")
)
(if (or(= 结构 "双隅砖木")(= 结构 "砖木"))
(setq 结构1 "C")
)
(if (= 结构 "简易")
(setq 结构1 "E")
)
(command "text" (polar (polar 左上角 (* 1.5 pi) (* 4.9 比例 )) 0 (* 12 比例)) (* 0.3 比例)"" 结构1)
(command "chprop"(entlast) """LA" "结构" "")
(command "text" (polar (polar 左上角 (* 1.5 pi) (* 5.6 比例 )) 0 (* 11 比例)) (* 0.3 比例)"" 层数)
(command "chprop"(entlast) """LA" "层数" "")
(command "text" (polar (polar 左上角 (* 1.5 pi) (* 6.35 比例 )) 0 (* 11 比例)) (* 0.3 比例)"" 建基)
(command "chprop"(entlast) """LA" "用地" "")
(command "text" (polar (polar 左上角 (* 1.5 pi) (* 23.6 比例 )) 0 (* 3 比例)) (* 0.4 比例)"" 建基)
(command "chprop"(entlast) """LA" "用地" "")
(command "text" (polar (polar 左上角 (* 1.5 pi) (* 7 比例 )) 0 (* 11 比例)) (* 0.3 比例)"" 建基)
(command "chprop"(entlast) """LA" "建基" "")
(command "text" (polar (polar 左上角 (* 1.5 pi) (* 7.7 比例 )) 0 (* 11 比例)) (* 0.3 比例)"" 总建)
(command "chprop"(entlast) """LA" "总建" "")
(if (/= 最终地址 nil)
(有地址1)
)
(setq 地号左上角 (polar (polar 字头座标 pi (* 7.5 比例)) (* 1.5 pi) (* 9.2 比例)))
(command "insert" "地号11" "s" 比例地号左上角 "" "" "")
(command "explode" (entlast))
(command "explode" (entlast))
)
)
(defun 删除表格子程序()
(setq c 0)
(setq 右下角 (polar (polar 左上角 (* pi 1.5) (* 22.5 比例)) 0 (* 19.5 比例)))
(setq 要删表格 (ssget "W" 左上角 右下角'((8 . "表格"))))
(command "erase" 要删表格 "")
(setq 文字右下角 (polar (polar 左上角 (* pi 1.5) (* 12.5 比例)) 0 (* 19.5 比例)))
(setq 面积内容 (ssget "W" 左上角 文字右下角'((1 . "**"))))
(setq lE (sslength 面积内容))
(repeat le
(SETQ D (cdr(assoc 1(entget (SSNAME 面积内容 C)))))
(setq d1 (SSNAME 面积内容 C))
(setq lb (cons d lb))
(setq c (+ 1 c))
)
(command "erase" 面积内容 "" )
(setq 结构地址 (ssget "W" 左上角 文字右下角'((1 . "~*#*"))))
(setq lE (sslength 结构地址))
(setq c 0)
(repeat le
(SETQ D (cdr(assoc 1(entget (SSNAME 结构地址 C)))))
(setq d1 (SSNAME 结构地址 C))
(setq lbjg (cons d lbjg))
(setq c (+ 1 c))
)
(command "erase" 结构地址 "")
(if(= le 1)
(只有结构))
(if (> le 1)
(地址结构))
)
(defun 只有结构()
(setq 结构 (car lbjg))
)
(defun 地址结构()
(setq 结构 (car lbjg))
(setq 地址 (cadr lbjg))
)
(defun 写地址()
(setq y 0)
(setq 地址左上角(polar 左上角 0 (* 2.6 比例)))
(setq 地址右下角(polar (polar 地址左上角 0 (* 4.6 比例)) (* 1.5 pi) (* 1.95 比例 )))
(setq 最终地址(ssget "W" 地址左上角 地址右下角'((0 . "text"))))
(if (/= 最终地址 nil)
(有地址)
)
)
(defun 有地址()
(setq y11 (cdr(assoc 10(entget(ssname 最终地址 0)))));地址座标
(command "move" 最终地址 "" y11 (polar(polar y11 0 (* 16.6 比例)) (* pi 1.5) (* 2 比例)))
)
(defun 有地址1()
(setq 移座标(cdr(assoc 10(entget(ssname 最终地址 0)))))
(setq wz (polar(polar 左上角 (* 1.5 pi) (* 3.5 比例)) 0 (* 10.5 比例)))
(setvar "osmode" 0)
(command "chprop"最终地址 """LA" "门牌号" "")
(command "move" 最终地址 "" 移座标 wz )
) 自己顶。。。。。。 将相应的表格制成属性块,需要填写的内容弄成属性! 会编程,你就试着编编,有不懂再问 Gu_xl 发表于 2013-6-1 17:26 static/image/common/back.gif
将相应的表格制成属性块,需要填写的内容弄成属性!
一个个做成块?麻烦啊。。。。 nzl1116 发表于 2013-6-1 17:27 static/image/common/back.gif
会编程,你就试着编编,有不懂再问
就是不会啊...加上时间不够啊。。。。。 被逼着交资料啊........ 自己顶!!!!!!!!!!!!
页:
[1]
2