Exploding DBText

Exploding DBText

cgcamilo
Enthusiast Enthusiast
1,612 Views
6 Replies
Message 1 of 7

Exploding DBText

cgcamilo
Enthusiast
Enthusiast

Hello,

 

I am using the RealDWG2015 sdk. I am using it to export dwg files into my own geometry representation.

 

Is there anyway to explode a DBText or get its text string as geomtry (Polyline for example)?

 

Thank you.

Camilo Cifuentes
0 Likes
1,613 Views
6 Replies
Replies (6)
Message 2 of 7

Ed__Jobe
Mentor
Mentor

See if this thread helps. https://www.theswamp.org/index.php?topic=31435.0

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 7

cgcamilo
Enthusiast
Enthusiast

Hello eljobe,

 

thanks for your replay. However, I belive the thread does not really help me.

What I am doing is reading a dwg file using the RealDWG2015 sdk and writing that geometry in my program. When I see a DBText or MText its kind of hard to translate those text into our geometry mainly because of all properties that DBText and MText has. Such rotation, attachment point, horizontal and vertical aligment, font, width, etc... that is why I am searching for a method (code) that can translate those texts into other entities such lines or polylines.

Camilo Cifuentes
0 Likes
Message 4 of 7

Ed__Jobe
Mentor
Mentor

@cgcamilo wrote:

Hello eljobe,

 

that is why I am searching for a method (code) that can translate those texts into other entities such lines or polylines.

But that is what the program does. I don't understand why it doesn't fit your needs. Did you try it out?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 5 of 7

cgcamilo
Enthusiast
Enthusiast

Well, what that program does is to convert text as String to geometry. What I need is to convert DBText or MText entities to geometry.

Camilo Cifuentes
0 Likes
Message 6 of 7

Ed__Jobe
Mentor
Mentor

True, but I thought you were looking for code samples. Getting text properties is the easy part. The hard part is how to do the conversion. The zip file should contain a VS project that you can examine to find out a method of doing so.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 7 of 7

cgcamilo
Enthusiast
Enthusiast

Ed,

 

I saw the code samples. I can use the code and get some geometry from some text. However, even if getting the text properties is easy, building the correct text in the correct position is not that easy. As I said before, properties like attachment point, horizontal and vertical aligment, font, width makes the geometry placement hard to do. 

 

For example, I use the code provided for a certain text. It returns a polyline (or whatever). Then, I have to place that polyline that represents the text in certain position in my 2d world. Depending on attachment point, (top-left, top-center, top-right, mid-left, ...) I will have to apply lots of transformations so the text geometry will be in correct place. Then I have to consider the rotation (again, check if it is from the top-left, top-center, ....) and so on. This is the tricky part.

 

That is why I would like to know if someone has a solution that, giving a DBText or MText  returns some entities (polylines or whatever) which I can easily place.

Camilo Cifuentes
0 Likes