Does anyone know how to quickly put the center point of the 10,000 texts on the drawing back to the center point of the circle corresponding to the drawing? Can it be realized with DYNAMO?

I want all Text should be placed to the center point of circles and ellipses. Please tell me how to do thx QAQ


Hi
I checked your file and it’s hard to see a pattern because the text is not inserted to the same position relative to the object, not even for text within the same layers. For this reason I think it would be difficult to design a graph for this issue

Then I would like to advice you to read this thread How to get help on the Dynamo forums - FAQ - Dynamo (dynamobim.com). Normally the standard reply to a thread where the threadstarter ask “Tell me how to do this” is “What have you tried so far, and can you upload your graph”

3 Likes

[3131N-MMH-AIAG-UU-DR-AGL_Circle_v3.dwg|attachment]
Hello, thank you for your reply. This is the sorted file. I would like to ask how to move the point of the text of layer 0 in DWG Move all text to the closest ellipse and circle the center Point

Oki, what have you tried so far? Please share your graph

I checked the last dwg and I don’t know how to deal with it.

The text justify is different for the texts and I don’t see any similarities between the location according to the circles and then, if I should change the justification, it will change the placement of the text and make it hard to create a graph that handle this issue



I found that All objects on Layer cannot read the ellipse. This caused the 2000 ellipse on the graph to be ignored.

Can you share the .dyn file, not a screenshot.

1 Like

OKKK THX :joy:

No worries :smiley:

Hola Amigos buenas. Amiga @Ken.HoGXTTP you have a real problem here, I have never liked to work with individual elements and this is the reason why; I prefer to use always blocks with attributes, I leave you the way how you can do the query of the centers of circles, ellipses as well as the texts and their content, also note that there are 1852 more texts than centers of circles and / or ellipses, which means that there are orphan texts, I should also note that what you are trying to do is to compare 6991 x 8843 points, which is equivalent to 61 821 413 comparisons, too much even for a pc I will think about how to reduce the list, how do you see patrick?


You need Arkance, and ToolkitCivil3D packages

1 Like

I need to give up on this one. :frowning:

1 Like

How can I make this work :joy:

Hola Chaparrita @Ken.HoGXTTP como estas? I’m afraid I have bad news for you, I don’t think it is possible to make a script that automates this process, the file you are working with only has individual elements and they are not related to each other, I mean the lists you get are not in the same order, I thought they could be related by evaluating the proximity between them, but analyzing a little more closely the proximity values are very varied and you would get many false positives frankly I don’t think it can be done, sorry.


the best I can do for you is to propose you an old school process using blocks with attributes and the old and reliable find and replace, do you want to try this way? This could take weeks or months to finish and there are usually errors, but that’s what I would do in your place.

2 Likes

Please let me know if u can use the correlation method by evaluating the proximity between them. Can you please help me think about how to make a simple dynamo to solve and achieve part of the correction by evaluating the proximity between them @.@

Hola de nuevo. I think I am not expressing myself correctly, I do not think it is possible to relate both lists since there are not constant proximity values, in some cases the neighbor value is closer than the correct one, in other cases the correct value is very far away, really the problem is what distance value will you use to differentiate them? I can not think of anything, the second problem is the amount of items in the file I am sorry I can not help you but I leave you the way to evaluate distances.


Frankly I think that using blocks with attributes and a manual method using find would advance your work, I’m give up too, best of luck!

1 Like

Blocks is definitely the better way to go here; whatever workflow you used to get to this point ought to not be used again in the future.

Near term, your solution will be to process the text in smaller chunks. Build a vector from one text object to every possible location, get the shortest vector, and move the text by that vector, and them move the text to a new layer which is hidden. Anything on the hidden layer need not be processed. Once you have that working for one text element, set it up to work with 2. When it works with 2, you can start processing the model using one sets of 10, 20, 30… whatever level doesn’t lock up ACAD for ages. Keep processing in groups until all 7000+ text elements are shifted to where they want to be (meaning nothing is displayed on your current text layer), and then save, and move everything from the temp layer to the old text layer.

2 Likes

May I ask what tools can I use to actually create some functions? Can you help me? Thanks :innocent:

Some of the functions as I see them in my head and their use in the graph are as follows.

To get the circle centers efficiently I would look into some of these nodes:

All objects on layer.
Object.Extents
BoundingBox.MinPoint
BoundingBoxMaxPoint
Vector.ByTwoPoints
Vector.Scale
Geometry.Translate

To get the text locations:

Select Objects
Text.Location

To get the distances from the text to the circles

Vector.ByTwoPoints
Vector.Length
List.SortByKey
List.FirstItem

To move the text:

CoordinateSystem.Identity
CoordinateSystem.Translate
Object.Transform

To set the layer:

String
Object.SetLayer

Try and build the tool to move just one text element. Then try to move two. From there you’re done. If you get stuck, post back here and I’ll try to help.

2 Likes

(upload://1xPd5zzUlw614zY0Wx0P70pLYwP.dyn) (55.7 KB)
Thanks for the hint, according to your hint, I got a dynamo initial shape. I ran it in two different cases. But it seems that there are some problems in test_real.dwg. What is the reason? The effect of EXAMPLE_v2.dwg seems to be OK. :joy:Could you please help me to solve the problem. :innocent:
EXAMPLE_v2.dwg (940.9 KB)
test_real.dwg (5.7 MB)


MoveTextToClosestPoint_EX_v2.dyn (55.7 KB)

Index 64 is failing, and the object at index is a block refernce.

Block references don’t have geometry (but their source blocks do), and as such Object.Geometry will fail.

Utilizing the boundingbox (called extents in AutoCAD) instead will circumvent that issue, but may result in putting something at the center of a line, or otherwise not on a circle.

1 Like