Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hello friends , I am new Creo Customization , and I am struck in placement of drawing view in temples , I have already created a template just call it and display it , now I want to add views , please help me to overcome the problem .
Regards,
Kunal
Once you are in the Template mode in the drawing, you can create views from the Template Views option. See snapshot:
Hope this helps.
Perhaps I'm misunderstanding your post, but your message makes it sound like the template that you created is empty, that you have created a drawing from template, and now are now seeking to creating views. ProDrawingFromTmpltCreate does not create a template, its creating a drawing based on a template.
The purpose of a template is to have the views pre created. Manually create a template and set up the views as suggested by manju. Then use ProDrawingFromTmpltCreate to create a drawing and the views are automatically there.
如果你是通过二次开来添加视图
1、你可以打开一个工程图或是通过代码创建一个新的工程图都可以
2、在你通过代码放置视图之前,有一个很重要的动作,就是工程图一定要显示出来,否则会抛出异常
3、然后开始放置一般视图
a、通过pfcView2D.GeneralViewCreateInstructions_Create创建构造器
GeneralViewCreateInstructions instrs = pfcView2D.GeneralViewCreateInstructions_Create (model,drawing.GetCurrentSheetNumber(),pos,transf );
b、然后通过工程图创建视图
view2D = drawing.CreateView (instrs);
c、如果创建成功,重生一下这个视图或是工程图
view2D.Regenerate();
最后可以重生一下工程图
以上是一般视图,如果放置投影视图的话,构造器不同而已,其他差不多
ProjectionViewCreateInstructions pInstrs = pfcView2D.ProjectionViewCreateInstructions_Create (parentView2D, pos);
view2D = drawing.CreateView (pInstrs);
需要指定位置和父视图就可以了
当然你创建后视图后,就可以设置此视图的相关属性了,比如显示样式、切线样式等