资源简介

算是tekla二次开发的一下入门资料,里面包含一些实例的C#源代码,对于初学者来说还是很有帮助的

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Windows.Forms;
using Tekla.Structures;
using Tekla.Structures.Model;
using Tekla.Structures.Drawing;
using TSMUI = Tekla.Structures.Model.UI;

namespace DrawingTestApplication1
{
    public partial class BasicViews : Form
    {
        public BasicViews()
        {
            InitializeComponent();
        }

        private Model Model = new Model();
        private DrawingHandler DrawingHandler = new DrawingHandler();

        #region Coordinate system calculations

        readonly Tekla.Structures.Geometry3d.Vector UpDirection = new Tekla.Structures.Geometry3d.Vector(0.0 0.0 1.0);
        /// 
        /// Gets part default front view coordinate system
        /// Gets coordinate system as it is defined in the TS core for part/component basic views which is different than in singlepart/assembly drawings.
        /// 

        /// jectCoordinateSystem“>
        /// 
        private Tekla.Structures.Geometry3d.CoordinateSystem GetBasicViewsCoordinateSystemForFrontView(Tekla.Structures.Geometry3d.CoordinateSystem objectCoordinateSystem)
        {
            Tekla.Structures.Geometry3d.CoordinateSystem result = new Tekla.Structures.Geometry3d.CoordinateSystem();

            result.Origin = new Tekla.Structures.Geometry3d.Point(objectCoordinateSystem.Origin);
            result.AxisX = new Tekla.Structures.Geometry3d.Vector(objectCoordinateSystem.AxisX) * -1.0;
            result.AxisY = new Tekla.Structures.Geometry3d.Vector(objectCoordinateSystem.AxisY);
            
            Tekla.Structures.Geometry3d.Vector tempVector = (result.AxisX.Cross(UpDirection));
            
            if(tempVector == new Tekla.Structures.Geometry3d.Vector())
                tempVector = (objectCoordinateSystem.AxisY.Cross(UpDirection));

            result.AxisX = tempVector.Cross(UpDirection).GetNormal();
            result.AxisY = UpDirection.GetNormal();

            return result;
        }
        
        /// 
        /// Gets part default top view coordinate system
        /// Gets coordinate system as it is defined in the TS core for part/component basic views which is different than in singlepart/assembly drawings.
        /// 

        /// jectCoordinateSystem“>
        /// 
        private Tekla.Structures.Geometry3d.CoordinateSystem GetBasicViewsCoordinateSystemForTopView(Tekla.Structures.Geometry3d.CoordinateSystem objectCoordinateSystem)
        {
            Tekla.Structures.Geometry3d.CoordinateSystem result = new Tekla.Structures.Geometry3d.CoordinateSystem();

            result.Origin = new Tekla.Structures.Geometry3d.Point(objectCoordinateSystem.Origin);
            result.AxisX = new Tekla.Structures.Geometry3d.Vector(objectCoordinateSystem.AxisX) * -1.0;
            result.AxisY = new Tekla.Structures.Geo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\
     文件      966384  2013-02-05 15:57  TeklaOpenAPIStartupPackage_v190\DevelopersGuide.pdf
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\
     文件         144  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\app.config
     文件       16727  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\BasicViews.cs
     文件        6039  2013-02-04 15:44  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\BasicViews.csproj
     文件        6360  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\BasicViews.Designer.cs
     文件        5814  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\BasicViews.resx
     文件         495  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Program.cs
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Properties\
     文件        1304  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Properties\AssemblyInfo.cs
     文件        2844  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Properties\Resources.Designer.cs
     文件        5612  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Properties\Resources.resx
     文件        1089  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Properties\Settings.Designer.cs
     文件         249  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\Properties\Settings.settings
     文件         186  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BasicViews\ReadMe.txt
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BoundingBoxDrawer\
     文件         144  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BoundingBoxDrawer\app.config
     文件        6252  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BoundingBoxDrawer\BoundingBoxDrawer.cs
     文件        4716  2013-02-04 15:44  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BoundingBoxDrawer\BoundingBoxDrawer.csproj
     文件       11512  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BoundingBoxDrawer\boundingboxes.png
     文件         104  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\BoundingBoxDrawer\ReadMe.txt
     目录           0  2014-08-05 10:09  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\DimensionCreator\
     文件         144  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\DimensionCreator\app.config
     文件        3742  2013-02-22 11:21  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\DimensionCreator\DimensionCreator.cs
     文件        6046  2013-02-04 15:44  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\DimensionCreator\DimensionCreator.csproj
     文件        2123  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\DimensionCreator\Form1.cs
     文件       13523  2013-02-04 15:02  TeklaOpenAPIStartupPackage_v190\Examples\Drawings\Applications\DimensionCreator\Form1.Designer.cs
............此处省略363个文件信息

评论

共有 条评论