云文档网 - 专业文章范例文档资料分享平台

用CATScript 做的CATIA标题栏和工程图框

来源:网络收集 时间:2024-05-04 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xuecool-com或QQ:370150219 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

用CATScript 做的CATIA标题栏和工程图框

使用方法:drafting--〉edit--〉background--〉tools--〉macro--〉macros中select本文件,run即可。

环境变量设置(很实用)

CATLM_ODTS=1 - Disable license error messages at startup

L_WILSON_LAN=1 - Access to Wilson's spline curves

CGM_ROLLINGOFFSET=1 - Access to the Rolling Offset option in GSD

TAILLE_MEMOIRE_CHOISIE=1 - Optimize IGES export memory CATNoStartDocument=no - Disable product at startup CNEXTBACKGROUND = no - Disable sky background at startup CNEXTSPLASHSCREEN = no - Disable display of planet at startup

SHOW_CST_CHILDREN = 1 - Display stresses in the parents specification tree in sketcher

CNEXTOUTPUT = console - Display Catia's logs in command windows

MM_NO_REPLACE = 1 - Associativty about replacement of components cloned with different

标题栏.CATScript

代码:

'COPYRIGHT DASSAULT SYSTEMES 2001 '

****************************************************************************

' Purpose: To draw a Frame and TitleBlock

' Assumptions: A Drafting document should be active

' Author: 庞军杰,王晓军 ' Languages: VBScript ' Version: V5R7 '

****************************************************************************

Public DrwDocument As DrawingDocument Public DrwSheets As DrawingSheets Public DrwSheet As DrawingSheet Public DrwView As DrawingView Public DrwTexts As DrawingTexts Public Text As DrawingText Public Fact As Factory2D Public Point As Point2D

Public Line As Line2D Public Cicle As Circle2D Public Selection As Selection

Public GeomElems As GeometricElements

Public Height As Double 'Sheet height Public Width As Double 'Sheet width Public Offset As Double 'Distance between the sheet edges and the frame borders

Public OH As Double 'Horizontal origin for drawing the titleblock

Public OV As Double 'Vertical origin for drawing the titleblock

Public Col(16) As Double 'Columns coordinates Public Row(6) As Double 'Rows coordinates

Public colRev(4) As double 'Columns coordinates of revision block Public TranslationX As Double 'Horizontal translation to operate when changing standard Public TranslationY As Double 'Vertical translation to operate when changing standard

Public displayFormat As String 'Sheet format according to standard

Public sheetFormat As catPaperSize 'Sheet format as integer value

'new variable

Public RowWidth As Double 'Sheet width Public ObjAmount As Double

Public Coll(8) As Double 'Collumns coordinates Public Rowl(53) As Double 'Rowls coordinates ObjAmount=i+3 'end

Const mm = 1 Const Inch = 254 Const RulerLength = 200

Const MacroID = \Const RevRowHeight = 10

Sub CATMain() CATInit

On Error Resume Next

name = DrwTexts.GetItem(\ If Err.Number <> 0 Then Err.Clear

name = \ End If

On Error Goto 0

If (name = \ CATDrw_Creation End If End Sub

Sub CATDrw_Creation()

'-------------------------------------------------------------------------------

'How to create the FTB

'------------------------------------------------------------------------------- CATInit 'To init public variables & work in the background view If CATCheckRef(1) Then Exit Sub 'To check whether a FTB exists already in the sheet

CATStandard 'To compute standard sizes

CATReference 'To place on the drawing a reference point CATFrame 'To draw the frame

CATTitleBlock 'To draw the TitleBlock and fill in it

'****************************** 'If ObjAmount>0 Then

' CATTitleObjBlock 'To draw the TitleBlock and fill in it ' Else Exit Sub ' End If

'******************************

End Sub

Sub CATInit()

'-------------------------------------------------------------------------------

'How to init the dialog and create main objects

'-------------------------------------------------------------------------------

Set DrwDocument = CATIA.ActiveDocument

Set DrwSheets = DrwDocument.Sheets Set Selection = DrwDocument.Selection Set DrwSheet = DrwSheets.ActiveSheet

Set DrwView = DrwSheet.Views.ActiveView Set DrwTexts = DrwView.Texts

Set Fact = DrwView.Factory2D

Set GeomElems = DrwView.GeometricElements

End Sub

Sub CATStandard()

'-------------------------------------------------------------------------------

'How to compute standard values

'-------------------------------------------------------------------------------

Height = DrwSheet.GetPaperHeight Width = DrwSheet.GetPaperWidth sheetFormat = DrwSheet.PaperSize

Offset = 10.*mm 'Offset default value = 10.

If (sheetFormat = CatPaperA0 Or sheetFormat = CatPaperA1 Or sheetFormat = CatPaperUser And _ (DrwSheet.GetPaperWidth > 594.*mm Or DrwSheet.GetPaperHeight > 594.*mm)) Then

Offset = 20.*mm End If

OH = Width - Offset OV = Offset

documentStd = DrwDocument.Standard If (documentStd = catISO) Then If sheetFormat = 13 Then displayFormat = \ Else

displayFormat = \ End IF Else

Select Case sheetFormat Case 0

displayFormat = \

Case 1

displayFormat = \ Case 7

displayFormat = \ Case 8

displayFormat = \ Case 9

displayFormat = \ Case 10

displayFormat = \ Case 11

displayFormat = \ Case 12

displayFormat = \ Case 13

displayFormat = \ End Select End If

End Sub

Sub CATReference()

'-------------------------------------------------------------------------------

'How to create a reference text

'-------------------------------------------------------------------------------

Set Text = DrwTexts.Add(\ Text.Name = \End Sub

Function CATCheckRef(Mode As Integer) As Integer

'-------------------------------------------------------------------------------

'How to check that the called macro is the right one

'-------------------------------------------------------------------------------

nbTexts = DrwTexts.Count i = 0

notFound = 0

While (notFound = 0 And i

Set Text = DrwTexts.Item(i) WholeName = Text.Name

百度搜索“yundocx”或“云文档网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,云文档网,提供经典综合文库用CATScript 做的CATIA标题栏和工程图框在线全文阅读。

用CATScript 做的CATIA标题栏和工程图框.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.yundocx.com/wenku/409179.html(转载请注明文章来源)
Copyright © 2018-2022 云文档网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:370150219 邮箱:370150219@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:7 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219