求大神写一个像天正的定义视口那样的插件····
求大神写一个像天正的定义视口那样的插件····那就用这个,为什么还要重复劳动? st788796 发表于 2014-3-21 13:10
那就用这个,为什么还要重复劳动?
因为我不用天正
windowns456 发表于 2014-3-21 14:05
因为我不用天正
;|------------ Viewport Creator ----------------
q_|_|| _\|| q_|| _\|
- Select area
- ask for viewport scale
- Go to last layout (first at right)
- Ask for center point of viewport
- Create a viewport
- view the selected area with the viewport
Create stations for Prestresed tendon
------------------------------------------------
Author: Hasan M. Asous, 2010
ALL RIGHT RESERVED TO ALL
Contact: HasanCAD @ TheSwamp.org,
asos2000 @ CADTutor.net
HasanCAD@gmail.com
------------------------------------------------
Version: 1 2012 07 01
________________________________________________
|;
; q_|_|| _\|| q_|| _\| ;
; Mainroutine Start ;
(defun c:NV (/ doc p1 p2 temp mp
scl SC cd:DWG_LayoutsList res
a b vpp vpdoc vp
)
(vl-load-com)
(setq Doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(setq p1 (getpoint "\Select objects to view:"))
(setq p2 (getcorner p1))
(if
(< (car (trans p2 1 0)) (car (trans p1 1 0)))
(setq tmp p1
p1p2
p2tmp
)
T
)
(setq mp (list (/ (+ (car p1) (car p2)) 2)
(/ (+ (cadr p1) (cadr p2)) 2)
0.0
)
)
(setq sc (cond ((getint (strcat "\nWhat is Viewport Scale 1: <"
(itoa (setq sc (cond (sc)
(50)
)
)
)
">: "
)
)
)
(sc)
)
)
(setq cd:DWG_LayoutsList
(vlax-for % (vla-get-layouts Doc)
(setq res (cons (list (vla-get-name %)
(vla-get-TabOrder %)
%
)
res
)
)
)
)
(setvar "CTab"
(caar (vl-sort cd:DWG_LayoutsList
'(lambda (a b) (> (cadr a) (cadr b)))
)
)
)
(setq VPDoc (vla-get-PaperSpace doc))
(setq VPp (vlax-3D-point (getpoint "\nSelect Point for Viewport")))
(setq VP (vla-AddPViewport
VPDoc
VPp
(/ (- (car p2) (car p1)) sc)
(/ (- (cadr p2) (cadr p1)) sc)
)
)
(vla-display VP :vlax-true)
(vla-put-mspace doc :vlax-true)
(vla-put-activepviewport Doc VP)
(vla-zoomcenter
(vlax-get-acad-object)
(vlax-3d-point mp)
1.0
)
(vl-cmdf "_.zoom" (strcat (RTOS (/ 1.0 SC)) "xp"))
(vla-regen (vla-get-activedocument (vlax-get-acad-object))
acActiveViewport
)
(vla-put-mspace doc :vlax-FALSE)
(VLA-PUT-DisplayLocked VP :vlax-true)
)
(princ "\n TypeNVto Invoke")
(princ)
st788796 发表于 2014-3-21 14:24
谢谢你···我加载上了,可用不了···
st788796 发表于 2014-3-21 14:24
天正的话,是在布局1或布局2中 用定义视口命令 自动跳转到模型中,框选要创建的图纸 ,再输入比例,自动转回到布局1或布局2指定位置放置那个视口!
在模型中用 st788796 发表于 2014-3-21 16:18
在模型中用
谢谢你······
看来楼主的插件还要用金山汉化一下啊! tianyi1230 发表于 2014-3-22 21:51
看来楼主的插件还要用金山汉化一下啊!
Select Point for Viewport; 错误: Automation 错误。 参数 Height (位于 AddPViewport method
中) 无效
这是什么错误 啊···
st788796 发表于 2014-3-21 16:18
在模型中用
Select Point for Viewport; 错误: Automation 错误。 参数 Height (位于 AddPViewport method
中) 无效
Select Point for Viewport; 错误: Automation 错误。 参数 Height (位于 AddPViewport method
中) 无效
这个错误该怎么解决的 chen7560152 发表于 2019-11-6 13:46
Select Point for Viewport; 错误: Automation 错误。 参数 Height (位于 AddPViewport method
中) 无效
...
坐标顺序是左下右上,左下的角点的坐标要都小于右上的
这个好用,不知道以上的问题解决了吗?试一下 写过一个
页:
[1]