下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、Catia百格線生成宏你是否為在 Catia 做 2D 圖紙的時候,畫百格線而傷腦筋呢別擔(dān)心,接下來 我告訴你一個簡單的方法1. 新建一個 txt 文本文檔,比如2.把以下內(nèi)容復(fù)制到中=這里開始,不要復(fù)制我=Option ExplicitI * Purpose:This macro allows you to create Grid line in CATIAdrawing Author: chenqa Languages:VBScript Locales:English Developing CATIA Level: V5R12View mush parallel to system aix
2、es,view angle 0deg,90deg and -90degI *Sub CATMain()= FalseDim sStatus As String Set the CATIA popup file alerts to FalseIt prevents to stop the macro at each alert during its execution= False Optional: allows to find the sample wherever its installed Variables declarationDim oDrwDocument As DrawingD
3、ocumentDim oDrwSheets As DrawingSheetsDim oDrwSheet As DrawingSheetDim oDrwView As DrawingViewDim oFactory2D AS Factory2D The Distance between the linesDim D As IntegerDim nx As IntegerDim ny As Integer The point coordinate select from DrawingDim X1 As IntegerDim Y1 As IntegerDim X2 As IntegerDim Y2
4、 As IntegerDim Pt1 As Point2DDim Pt2 As Point2DThe view scale dAngle for rotate view scale for view scaleDim dScale,dAngle As DoubleThe view coordinate originDim X As IntDim Y As IntDim xSel AsD= InputBox(Please Input the Distance Value, input box, 100)D= Cint (D) Retrive a new drawing documentSet o
5、DrwDocument =Retrieve the drawing documents sheets collectionSet oDrwSheets =Retrieve the active sheetSet oDrwSheet =Retrieve the active view of the sheetSet oDrwView =Retrive the value of the viewX=Y=dScale =dAngle=Set oFactory2D =Get the coordinate from the select two pointOn Error Resume NextSet
6、xSel =ReDim sFilter(0)sFilter(0) = Point2DMsgBox Please select the left-bottom point sStatus =(sFilter, Select First Point., false) If (sStatus = Normal)ThenDim SelectedPoint1 As SelectedElementSet SelectedPoint1 = (1)Dim pt1Coord(2) As Int( pt1Coord )MsgBox The frst point has been selected Else Msg
7、Box Select a 2D Point 1Exit SubEnd IfMsgBox Please select the ritht-top point sStatus = (sFilter, Select The Second Point., false)If (sStatus = Normal) ThenDim SelectedPoint2 As SelectedElementSet SelectedPoint2 = (1)Dim pt2Coord(2) As Int( pt2Coord )MsgBox The second point has been selected Else Ms
8、gBox Select a 2D point 1Exit SubEnd Ifif dAngle=0 thenX1= Cint( (pt1Coord(0) - X)/dScale)Y1= Cint (pt1Coord(1) - Y)/dScale)X2= Cint (pt2Coord(0) - X)/dScale)Y2= Cint (pt2Coord(1) - Y)/dScale)end ifMsgBox (pt1Coord(0)MsgBox Xif dAngle0 thenX1=Cint(pt1Coord(1)-Y)/dScale)Y1=Cint (pt1Coord(0) -X)/dScale
9、) X2= Cint(pt2Coord(1)-Y)/dScale) Y2= Cint(pt2Coord(0)-X)/dScale) end ifif dAngle0 thenDi_V=-Di_Vend ifif dAngle0 thenset Line2D1 = (X1-D/3,-Y1-D*i,X1+nx*D+D/3,-Y1-D*i)Line2D1set Circle2D1=(X1+nx*D+D/3 +R,-Y1-D*i,R)Circle2D1set Line2D1=(X1+nx*D+D/3+R,-Y1-D*i+R,X1+nx*D+D/3+R,-Y1-D*i-R)Line2D1Set MyText = +TextV,-Y1-D*i) = catMiddleCenter0, 0, iFontSizeSet MyText = -TextV,-Y1-D*i) = catMiddleCenter0, 0, iFontSize end ifif dAngle0 then set Line2D1 =(X1+D*j,-Y1+D/3,X1+D*j,-Y1-ny*D-D/3)Line2D1set Circle2D1=(X1+D*j,-Y1+D/3+R,R)Circle2D1set Line2D1 = (X1+D*j,-Y1+D/3+R*2,X1+D*J,-Y1+D/3)Line
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 《銷售人員培訓(xùn)方案》課件
- 肱骨干骨折的健康宣教
- 《保險營銷渠》課件
- 卡波西水痘樣疹的臨床護(hù)理
- 《機(jī)械設(shè)計(jì)基礎(chǔ)》課件-第0章
- 《改革開發(fā)的時代》課件
- 外耳道乳頭狀瘤的健康宣教
- 毛發(fā)腺瘤的臨床護(hù)理
- 中國共產(chǎn)黨精神譜系(威海職業(yè)學(xué)院)知到智慧樹答案
- 《計(jì)算題解答》課件
- 2024年護(hù)士資格考試專業(yè)實(shí)務(wù)試卷及解答參考
- GB/T 44815-2024激光器和激光相關(guān)設(shè)備激光束偏振特性測量方法
- 住建局條文解讀新規(guī)JGJT46-2024《施工現(xiàn)場臨時用電安全技術(shù)標(biāo)準(zhǔn)》
- 國家開放大學(xué)《當(dāng)代中國政治制度》期末復(fù)習(xí)題
- 北京市海淀區(qū)2023-2024學(xué)年五年級上學(xué)期數(shù)學(xué)期末試卷
- 走近大詩人學(xué)習(xí)通超星期末考試答案章節(jié)答案2024年
- 2024至2030年中國茉莉花茶行業(yè)市場深度分析及未來發(fā)展趨勢預(yù)測報告
- 倉庫安全培訓(xùn)考試題及答案
- 公路工程標(biāo)準(zhǔn)施工招標(biāo)文件(2018年版)
- 抖音公會公司運(yùn)營制度
- 當(dāng)代世界經(jīng)濟(jì)與政治考試復(fù)習(xí)題及答案
評論
0/150
提交評論