I'm trying to Create a script standardisess the look of our models to that end I want to be able to add a Text Box in the Upper Left hand corner of All those Models.
In the text box I want to display specific information so that thing like the author, last update date etc are in line of site of the viewer.
However I'm really struggling with this one.
I can create Label but I just can't get the label onto each or any of the workspaces.
I just don't seem to be able to;
create the workspace shape without it creating an TDM exception
set the ParentBaseID of the label for a Workspaceshape object
I tried looking at the XML that was produced when I did it manually but just couldn’t reproduce it.
The WorkspaceShapeLabelQuadrangle seems to get created but it gives an exception error. I can see the resultant elements and attributes appear in the XML.
Hi Sandy,
unfortunately there is no setting to align text in label rectangle to left.
Maybe you can use instead text label just t a text. And if you want to have rectangle around you can combine it with rectangle. So script will be similar
function main(){
var WorkSpace = Model.Workspaces.GetObjectByName("All Items")
var SimpleText = Model.CreateNewObject(1076);//Simple Text
SimpleText.Name = 'testName';
SimpleText.SimpleText = 'text as asd f f \r\n fasdf asdf';
var wsSimpleText = WorkSpace.NewWorkSpaceShape(1509, SimpleText);
wsSimpleText.Name = SimpleText.Name;
var Rect = Model.CreateNewObject(1074);//Rectange
var wsRect = WorkSpace.NewWorkSpaceShape(1507, Rect);
wsRect.ZOrder = -10; //We want to rectangle will be always on backward
}