

Ask the user to select the objects to copy to:
#Tekla string operations code#
You can get the source object in the same manner as the above code – except you would use the PickObject method instead of the PickObjects (plural) method. Ask the user to select the source object: This returns a ModelObjectEnumerator which we can iterate over.Ģ. And there is a handy object which thankfully has been exposed: PickObjects(Picker.PickObjectsEnum, String). We can use the Picker class, located in the namespace. Ask the user to select a bunch of model objects – The objects to copy

We want the user to then select all objects to copy to.We then want the user to select a “source” object.We want the user to select an object (or group of objects).This is fantastic! Now let us outline what we want the command to do: What do we want our command to do? Here is the hello world example, straight from the documentation: Copying Object to Object – Hello World Example: But it’s static method in the Operation class. Where is the pertinent Call in the API? I’d prefer this type of thing to be a method on the relevant ModelObject. In this lesson we will create some code, using the Open API, to allow users to select multiple objects (all at once) by which the copy object to object command can be applied to. We need to pass the file location path to File.OpenText() method to open the text file. It gives Read() and ReadLine() methods to read data from the stream. It’s handy, but it could be made better: all the model objects have to be selected individually. It is very easy to read a text file in C, we use StreamReader class is used to read a string from the stream and can be found under System.IO namespace. There is a nifty little command – little oft used in Tekla. What is the task at hand? We want to make the Copy Object To Object command more efficient An example of us copying a column from one object, to the rest – to the rest of the beams.
