I set a tube label but now I want to drag it, move it and rotate it.
I’m trying for “.DraggedOffset” which the API promises to set a new point, but it doesn’t work.
It looks like you’ve opened the label as ForRead?
I created the Pipe Label with:
PipeLabel = Autodesk.Civil.DatabaseServices.PipeLabel.Create(Pipe_Ids,0.5,PipeLabelStyles_Ids)
And it returned me the PipeLabel ID
Then, used Label=TS.GetObject(t,PipeLabel,OP.ForRead) to get the civil object, so I could use it as a PipeLabel object (and then drag it, move it, etc). But unfortunatelly it didn’t work.
Right, so wouldn’t you need to open the object as ForWrite to modify the property?
Ok, I changed it to ForWrite, but it still didn’t drag the label.
I don’t know if “LabelLocation.Add” is the correct way to drag it. I used it because from what I found in the API Reference Guide, the “DraggedOffset” was the more obvious property to do what I wanted. Reading the syntax, it is stated that it’s an obsolete attribute, and they recommend “Use property LabelLocation instead.”
Here is the link to the LabelGroupSubEntity Members: Help
I uploaded a video showing what I want to do. I want to write a script that could allow me to drag a label and place it in a known place (following a vector, point, etc)
I’m not sure
before line 92 With the item opened
In one picture
Is it possible to share
to work on it
I saw your other post and made the similar code and I got it! Thank you very much!!!
The post for everyone: https://forum.dynamobim.com/t/draggedoffset-property-label/65826
Will you be able to share the script?
Nice! I’m glad you guys developed things like that! Now I’m working with Pressure Networks, it’s all very recent and there are no things we can do via the API, like create a fitting.