ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc

上传人:rrsccc 文档编号:11045615 上传时间:2021-06-21 格式:DOC 页数:12 大小:32KB
返回 下载 相关 举报
ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc_第1页
第1页 / 共12页
ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc_第2页
第2页 / 共12页
ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc_第3页
第3页 / 共12页
ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc_第4页
第4页 / 共12页
ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc》由会员分享,可在线阅读,更多相关《ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial).doc(12页珍藏版)》请在三一文库上搜索。

1、ug opengrip语言总结简明经典教程(UG OpenGRIP language summary concise classic tutorial)UG Open/Grip language summary concise tutorial, Grip language with complete syntax rules, procedures, structures, internal functions, Grip procedures must be compiled, connected, generated executable file, you can run. Grip

2、program can be used to achieve a variety of interactive operations with UG, such as geometry creation, file management, system parameter control, access to UG database, etc. This article summed up the Grip language syntax, and annotated explanation.Suoyuan notes$Grip start and compilation: first fin

3、d the installation path of UG, such as C:Program FilesEDSUnigraphics NX.Enter the path of the $UGOPEN directory, find grade.bat file, open it, the environment variable base_dirSet base_dir=C:Program FilesEDSUnigraphics is set to $NX, save and run.Suoyuan Grip program is written and compiled in Grip

4、run the program, type 4, where will you write Grip program.Suoyuan recorded written and enter. In the Grips running program, type 1, write the file name of the new Grip program and enter, at this timeSuoyuan Grip will open board, in which you can write your program. In the Grip run program, type 2 a

5、nd writeSuoyuan the compiled file, compile without error, type 3, write the linked file name, right after the completion of the link.You save $Grip program into the *.grs file, the Grip compiler will generate *.gri files, Grip will linkSuoyuan generated *.grx file, this file to run the file Grip.$Gr

6、ip program: open UG, click File-Execute-Grip, select the *.grx file, you can run it.The compiler should first compile sub Suoyuan function file, generate *.gri file does not need to link functions, then compile the main functionTo generate the *.gri file, the last link to $, *.grx.The main function

7、of $Grip file must end with HALT, Grip function file must end with RETURN.Suoyuan defined variables cannot exceed 6 characters, Grip would think that Point_1 and Point_2 are the same variables.Suoyuan line must not exceed 80 characters, if more than $symbols to wrap available.Suoyuan Grip insens, al

8、so known as Grip think POINT and point are painting point function, but I suggest GripSuoyuan function name and keyword uppercase, lowercase user defined variables. However, user defined variables cannot be associated with Grips.Suoyuan function name and keyword name.With the help of $Grip file in C

9、:EDSUnigraphics NXUGDOChtml_filesmainlibrary.chmOpenGRIP Reference $Guide. A handy Grip function lookup method: open. Word &Symbol ListsMajor Word List $, to check the function according to the first letter.Conclusion $HALTSuoyuan notesENTITY/p, l, C Suoyuan variable defined entityNUMBER/i, f (5) Su

10、oyuan numerical variable definitionSTRING/str (10) Suoyuan string variable definitionP=POINT/0,0,0 $paintingL=LINE/0,0,0,1,1,1 Suoyuan painting lineC=CIRCLE/CENTER, P, RADIUS, 1 $circleConclusion $HALTNotesENTITY/p (3)NUMBER/a (3), B (3,3)DATA/b, 1,2,3,4,5,6,7,8,9 to B Suoyuan vector assignmentA (1.

11、3) =b (1,1.3) a for $is equal to the first value vector in B vectorP (1) =POINT/a (1.3)P (2) =POINT/b (2,1.3)P (3) =POINT/b (3,1.3)Conclusion $HALTSuoyuan notesSTRING/str1 (100) $stringStr1=Hello Worldfor $string assignmentMESSG/str1 display string $Conclusion $HALTSuoyuan notesSuoyuan +, -, *, /, *

12、 * = $arithmetic functionLOGF, ABSF, $SQRTF, INTF, MODF, MINF, MAXF, SINF, COSF, ASINF, ACOSF, ATANF Suoyuan mathematical function$linefeedsNUMBER/aA=SINF (30)MESSG/FSTR (a)Conclusion $HALTSuoyuan notesNOTE/0,0, the display area to printLABEL1$UGPRINT/LABEL2to print text $INFOMATIONTo print text inf

13、ormation box $MESSG/LABEL3Conclusion $HALTSuoyuan notesSTRING/str1 (100), STR2 (100)NUMBER/strlenStr1=abcdefghijklmnStr2=SUBSTR (str1,2,5) Suoyuan take the characterStrlen=LENF (STR1) Suoyuan string length stringPRINT/FSTR (3.14) Suoyuan float into a stringPRINT/ISTR (strlen) Suoyuan integer into a

14、stringPRINT/str2Conclusion $HALTSuoyuan notesNUMBER/a (3), B (3), C, D (3), e, f (3), G (3)DATA/a, 1,2,3DATA/b, 4,5,6C=DOTF (a, b) Suoyuan vector multiplicationD=CROSSF (a, b) Suoyuan vector productE=VLENF (a) from vector norm SuoyuanF=SCALVF (10, a) Suoyuan vector multiplicationG=UNITF (a) Suoyuan

15、vectorPRINT/FSTR (c)PRINT/FSTR (d (1 +),+FSTR (d) (2) (d) +,+FSTR (3)PRINT/FSTR (E)PRINT/FSTR (f (1 +),+FSTR (f) (2) (f) +,+FSTR (3)PRINT/FSTR (g (1 +),+FSTR (g) (2) (g) +,+FSTR (3)Conclusion $HALTSuoyuan notesENTITY/c1, C2, L1ENTITY/p1, P2, P3, P4, P5, P6, P7, P8C1=CIRCLE/CENTER, (POINT/1,0,0), RAD

16、IUS, 1C2=CIRCLE/CENTER, (POINT/2,0,0), RADIUS, 1L1=LINE/0,0,0, -1,0,0P1=POINT/CENTER C1, the center $P2=POINT/YLARGE, INTOF, C1, C2 from the intersection of the maximum $along the Y directionP3=POINT/YSMALL, INTOF, C1, C2 from the intersection of the minimum $along the Y directionP4=POINT/ (POINT/0,

17、 -1,0), INTOF, C1, C2 (POINT/0, -1,0 Suoyuan from the nearest point)P5=POINT/p1, VECT, (LINE/p2, P3), YLARGE, P1 2 $points along the p2p3 vector to y maximum direction offset 2P6=POINT/c1, ATANGL, 45 $get round angle of 45 pointsP7=POINT/p1, DELTA, -2, -2,0 P1 $(-2, -2,0) bias pointP8=POINT/ENDOF, X

18、SMALL, L1 and L1 line endpoint SuoyuanConclusion $HALT$notesENTITY/cENTITY/ln1, LN2, Ln3, ln4, LN5, ln6, ln7C=CIRCLE/CENTER, (POINT/0,0,0), RADIUS, 1Ln1=LINE/0,0,0,1,0,0Ln2=LINE/PARLEL, ln1, YLARGE, 1 y along the direction parallel to the maximum Suoyuan ln1 line offset 1Ln3=LINE/PARLEL, ln1, YSMALL

19、, TANTO, C along the direction parallel to the minimum $Y ln1 and C circleLn4=LINE/ (POINT/0,0,0, ATANGL), 45 (0,0,0) over $45 painting lineLn5=LINE/ (POINT/2,0,0), RIGHT, TANTO, C (2,0,0) C cut over $round (right hand side)Ln6=LINE/ (POINT/0,0,0), PARLEL, LN5 (0,0,0) LN5 over $parallel lineLn7=LINE

20、/ (POINT/0,0,0), PERPTO, LN5 (0,0,0) LN5 over $vertical lineConclusion $HALTSuoyuan notesENTITY/c1, C2, C3, C4, C5, C6C1=CIRCLE/CENTER (POINT/0,0,0), RADIUS, 1 circle center and radius of over $C2=CIRCLE/CENTER (POINT/0,0,0), TANTO (LINE/2,0,0,2,2,0), START, 0, END, 90 central and tangent lines Suoy

21、uan start angle end angleC3=CIRCLE/CENTER (POINT/0,0,0), (POINT/3,0,0) a $center and pointC4=CIRCLE/ (POINT/4,0,0), (POINT/0,4,0), (POINT/-4,0,0) a $three point circleConclusion $HALTSuoyuan notesNUMBER/p (5,3)ENTITY/spDATA/p, 0,0,0,1,1,0,2,4,0,3,9,0,4,16,0Sp=SPLINE/ (POINT/p (1,1.3), (POINT/p (2,1.

22、3), (POINT/p (3,1.3), $(POINT/p (4,1.3), (POINT/p) (5,1.3) had various curves (dashed Suoyuan closed)Sp=SPLINE/CLOSED, (POINT/p (1,1.3), (POINT/p (2,1.3), $(POINT/p (3,1.3), (POINT/p (4,1.3), (POINT/p (5,1.3)A variety of curves (dashed Suoyuan closed)Conclusion $HALTSuoyuan notesENTITY/ln (4)ENTITY/

23、sph1, sph2, block1, cone1, cone2, cyl1, solid1, solid2Sph1=SPHERE/CENTER (POINT/0,0,0), RADIUS, 1 $painting ballSph2=SPHERE/ (CIRCLE/CENTER (POINT/0,0,0), RADIUS, 2) $to draw the ballBlock1=SOLBLK/ORIGIN, 2,2,2, SIZE, 1,1,1 $painting boxCone1=SOLCON/ORIGIN, 3,3,3, HEIGHT, 1, DIAMTR, 1,0 $coneCone2=S

24、OLCON/ORIGIN, 4,4,4, HEIGHT, 1, DIAMTR, 1,0.5, AXIS, 1,0,0 $painting tableCyl1=SOLCYL/ORIGIN, 5,5,5, HEIGHT, 1,diamtr,1美元画圆柱ln(1)=线/ 0,0,0,1,0,0ln(2)=线/ 1,0,0,1,1,0ln(3)=线/ 1,1,0,0,1,0ln(4)=线/ 0,1,0,0,0,0solid1 = solext / LN(1。4),身高,10,轴,转换拉伸实体美元solid2 = solrev / LN(1。4),起源,0,0,0,atangl、360、轴、旋转实体1,0,0美元停止结束语美元

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1