翻譯|使用教程|編輯:況魚杰|2019-11-12 13:59:56.810|閱讀 320 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學(xué)習(xí)。本文將會(huì)介紹工程圖后如何重新讀取對(duì)象的幾何特性(gPoints)。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問:
工程圖后如何重新讀取對(duì)象的幾何特性(gPoints)?
答:
您可以使用以下代碼:
private void ReadProps() { string msg = ""; System.Diagnostics.Debug.WriteLine("=====START===="); foreach (vdFigure item in vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Entities) { if (item is vdLine) {//vdLine's geometry is defined by two gPoints; the StartPoint and the EndPoint// vdLine line = item as vdLine; msg = "vdLINE StartPoint: " + line.StartPoint.ToString() + " EndPoint: " + line.EndPoint.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdPolyline) {//vdpolyline's geometry is defined by the VertexList which is a collection of points (Vertex)// vdPolyline polyline = item as vdPolyline; msg = "vdPOLYLINE VertexList: " + polyline.VertexList.ToString()+ "\r\n"; foreach (Vertex item2 in polyline.VertexList) { msg += item2.ToString() + "\r\n"; } System.Diagnostics.Debug.WriteLine(msg); } if (item is vdCircle) {//vdCircle's geometry is defined by the Center point and the Radius// vdCircle circle = item as vdCircle; msg = "vdCIRCLE Center: " + circle.Center.ToString() + " Radius: " + circle.Radius.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdRect) {//vdRect's geometry is defined by the InsertionPoint and the Width// vdRect rect = item as vdRect; msg = "vdRECT Insertion Point: " + rect.InsertionPoint.ToString() + " Width: " + rect.Width.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdArc) {//vdArc's geometry is defined by the Center point, the Radius, the StartAngle and the EndAngle// vdArc arc = item as vdArc; msg = "vdARC Center Point: " + arc.Center.ToString() + " Radius: " + arc.Radius.ToString() + " StartAngle: "+ arc.StartAngle.ToString() + " EndAngle: " + arc.EndAngle.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdEllipse) {//vdEllipse's geometry is defined by the Center point the StartAngle,the EndAngle, // the MajorAngle, MajorLength and the MinorLength// vdEllipse ellipse = item as vdEllipse; msg = "vdELLIPSE Center Point: " + ellipse.Center.ToString() + " StartAngle: " + ellipse.StartAngle.ToString() + " EndAngle: " + ellipse.EndAngle.ToString() + " MajorAngle: " + ellipse.MajorAngle.ToString() + " MajorLength: " + ellipse.MajorLength.ToString() + " MinorLength: " + ellipse.MinorLength.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdText) {//vdText's "geometry" is defined by the InsertionPoint, the Height and the Rotation// vdText text = item as vdText; msg = "vdTEXT Insertion Point: " + text.InsertionPoint.ToString() + " Heihgt: " + text.Height.ToString() + " RotationAngle: "+text.Rotation.ToString() + " Text: " + text.TextString.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdMText) {//vdMText's "geometry" is defined by the InsertionPoint and the Height// vdMText mtext = item as vdMText; msg = "vdMTEXT Insertion Point: " + mtext.InsertionPoint.ToString() + " Heihgt: " + mtext.Height.ToString() + " Text: " + mtext.TextString.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdInfinityLine) {//vdInfinityLine's geometry is defined by the BasePoint and the Direction// vdInfinityLine xline = item as vdInfinityLine; msg = "vdXLINE Base Point: "+xline.BasePoint.ToString()+" Direction: "+ xline.Direction.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vdPolyface) {//vdPolyface's geometry is defined by the VertexList which is a collection of points (gPoint)// vdPolyface cone = item as vdPolyface; msg = "vdPOLYFACE VertexList: " + cone.VertexList.ToString() + "\r\n"; foreach (gPoint item3 in cone.VertexList) { msg += item3.ToString() + "\r\n"; } System.Diagnostics.Debug.WriteLine(msg); } if (item is vdInsert) {//vdInsert's geometry is defined by the InsertionPoint, the Rotation, the scales and of course the block's objects)// vdInsert insert = item as vdInsert; msg = "vdINSERT Block Name: " + insert.Block.Name.ToString() + " Insertion Point: " + insert.InsertionPoint.ToString() + " RotationAngle: " + insert.Rotation.ToString() + "\r\n" + "vdINSERT Xscale: " + insert.Xscale.ToString() + " Yscale: " + insert.Yscale.ToString() + " vdINSERT Zscale: " + insert.Zscale.ToString(); System.Diagnostics.Debug.WriteLine(msg); } if (item is vd3DFace) {//vd3DFace's geometry is defined by the VertexList which is a collection of points (gPoint)// vd3DFace face = item as vd3DFace; msg = "vd3DFACE VertexList: " + face.VertexList.ToString() + "\r\n"; foreach (gPoint item4 in face.VertexList) { msg += item4.ToString() + "\r\n"; } System.Diagnostics.Debug.WriteLine(msg); }//vdPolyhatch's geometry is defined by the geometry of every vdCurve which that is consisted// if (item is vdPolyhatch) { vdPolyhatch hatch = item as vdPolyhatch; msg = "vdHATCH PolyCurves: " + hatch.PolyCurves.ToString() + "\r\n"; foreach (vdCurves item2 in hatch.PolyCurves) { foreach (vdCurve item3 in item2) { msg += "PolyCurve: " + item3.ToString()+"\r\n"; } } System.Diagnostics.Debug.WriteLine(msg); } } System.Diagnostics.Debug.WriteLine("=====END===="); }
請(qǐng)注意,所有這些對(duì)象還具有一個(gè)定義這些對(duì)象中某些對(duì)象的平面的拉伸向量(如vdInsert,vdCircle,vdEllipse,vdArc,vdText / MText,vdPolyhatch)。
對(duì)于以上問答,如果您有任何的疑惑都可以在評(píng)論區(qū)留言,我們會(huì)及時(shí)回復(fù)。此系列的問答教程我們會(huì)持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
熱門文章推薦:
如果您對(duì)想要購(gòu)買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系咨詢相關(guān)問題。
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: