Giter Site home page Giter Site logo

tsopenapiexamples's Introduction

tsopenapiexamples's People

Contributors

carlosherrero avatar contrast-security-sca[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tsopenapiexamples's Issues

examples?

Hi there.

I see no examples here?

rgds

Ben

How to create assembly in unit testing

Internal code of TeklaStructures creates assembly automatically when a part is inserted.
myPart.Insert();
myPart.GetAssembly(); // returns the assembly created by internal code

Originally posted by @CarlosHerrero in #13 (comment)

myPart.Insert();
this is not working for me as i have to do unit testing of my function which takes assembly as input and while unit testing i can not insert functionality

How to create Assembly

I want to create assembly I tried it by 2 ways
1)I have tried to create ArrayList of ModelObjects and then tried to create assembly using Assembly.Add method but its throwing error.

        List<ModelObject> modelObjectsList = new List<ModelObject>();
        Beam beam = new Beam();
        ModelObject modelObject = beam as ModelObject;
        modelObjectsList.Add(modelObject);
        ArrayList arrayListofAssemblables = new ArrayList();
        arrayListofAssemblables.Add(modelObjectsList);
        Assembly assembly = new Assembly();
        assembly.Add(arrayListofAssemblables);
  1. Passing model object to IAssemblable and then pass it to .Add method but its still throwing error that 'Assemblable is not valid'

         Beam beam = new Beam();
         ModelObject modelObject = beam as ModelObject;
         Assembly assembly = new Assembly();
         IAssemblable assemblable = modelObject as IAssemblable;
         assembly.Add(assemblable);
    

Example Error inexportXML

I have an exception error in line
Part myPart = myEnum.Current as Part; ERROR
Se omitió la carga de símbolos para el módulo mscorlib.dll optimizado porque está habilitada la opción Sólo mi código.

The compilation is OK
Could you help me

Operation.CopyObject(Part, oldCoordinate, newCoordinate) Successed, but the CoordinateSystem become null after model.CommitChanges();

I use the code below to copy a part form the selected one.
`private void TestCopyObject()
{
Picker Picker = new Picker();
Part Part = Picker.PickObject(Picker.PickObjectEnum.PICK_ONE_PART) as Part;

var oldCoordinate = Part.GetCoordinateSystem();
var solid = Part.GetSolid();
// The old coordinate system uses the model center point of the part as the origin.
oldCoordinate.Origin = new Point((solid.MinimumPoint.X + solid.MaximumPoint.X) / 2, (solid.MinimumPoint.Y + solid.MaximumPoint.Y) / 2, (solid.MinimumPoint.Z + solid.MaximumPoint.Z) / 2);

// Calculate the correct AxisY, making sure it is perpendicular to AxisX
var originalAxisX = oldCoordinate.AxisX;
var originalAxisY = oldCoordinate.AxisY;
var newAxisY = originalAxisX.Cross(originalAxisY);
newAxisY.Normalize(); // To Unit vector
var newCoordinate = new T3D.CoordinateSystem
{
    AxisX = new T3D.Vector(1, 0, 0),
    AxisY = newAxisY
};

Model model = new Model();

var newPart = Operation.CopyObject(Part, oldCoordinate, newCoordinate) as Part;

var newPartCoordinate = newPart.GetCoordinateSystem();
if (newPartCoordinate != null)
{
    Console.WriteLine($"The newPartCoordinate origin:{newPartCoordinate.Origin}, AxisX:{newPartCoordinate.AxisX},AxisY:{newPartCoordinate.AxisY}");
}


model.CommitChanges();


newPartCoordinate = newPart.GetCoordinateSystem();
if (newPartCoordinate == null)
{
    Console.WriteLine("The part coppied, has no CoordinateSystem.");
}
else
{
    Console.WriteLine("The part coppied, has correct CoordinateSystem.");
}

}`

Most of the time it is correct, but sometimes the copied part does not have a coordinate system.
I found that it copied the Part and its children,Does it also copied something else that causes the coordinate system to be abnormal after committing?Why did my copy fail?

image
image
image

I use the 2021 API

Example Code

On open the example code FormPlugin, all references are issued by Exclamation mark!

I uninstalled Tekla API and installed de tekla API exclamatin mark issu not solved
path en version on de propeties are not filled.

API 1 Licotec

regards Frank (Licotec)

Can't create WPF Plugin from scratch

I am able to create a new froms plugin, but I can't get a wpf plugin to build.

Steps to reproduce:

  1. Create new project .Net Framework Class library, .net framewrok 4.7.2
  2. Add {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} to csproj to let Visual Studio know this is WPF
  3. Add Tekla Open API nuget to csproj
  4. Add wpf references to csproj: PresentationCore, PresentationFramework, WindowsBase, System.Xaml
  5. Add WPF Window (xaml + xaml.cs)
  6. Inherit from PluginWindowBase

When I build I get the following error:
Error CS0234 The type or namespace name 'Structures' does not exist in the namespace 'My.NameSpace.Tekla' (are you missing an assembly reference?)

Do you know what causes this or can you provide a step-by-step guide to creating a WPF plugin?

https://developer.tekla.com/tekla-structures/documentation/tekla-open-api-ui-design-wpf

This guide details the creation of the plugin, but not the project creation, or the needed references

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.