Examples showing how to use Tekla Structures Open API
Select a different branch to see examples for that version of Tekla Structures
Please, visit https://developer.tekla.com/tekla-structures/tekla-open-api to find more information
Examples showing how to use Tekla Structures Open API
License: BSD 3-Clause "New" or "Revised" License
Examples showing how to use Tekla Structures Open API
Select a different branch to see examples for that version of Tekla Structures
Please, visit https://developer.tekla.com/tekla-structures/tekla-open-api to find more information
Hi there.
I see no examples here?
rgds
Ben
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
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);
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);
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
Please install our new product, Sonatype Lift with advanced features
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?
I use the 2021 API
ANY EXAMPLES FOR CREATE CROSS SECTION?
I am able to create a new froms plugin, but I can't get a wpf plugin to build.
Steps to reproduce:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.