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

当前位置:首页 > 用CATScript 做的CATIA标题栏和工程图框

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 23:19:57

用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 = \

搜索更多关于: 用CATScript 做的CATIA标题栏和工程图框 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

用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 m

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com