[Plugin] importDXFtext
-
Thanks for your work on this...
I'll look at it as soon as I have some free time and come back to you... -
Now I have finally the pieces for importing linear dimensionstogether.
If only the dimension lines without text shall be created in SketchUp it is pretty straight forward.
To also add the dimension text at he right position to the Sketchup dimension, a bit more is needed.
Pls find attached a text document with examples on the DXF codes needed.
The samples values are taken from our test file "dxfIn order to only create the dimension lines without adding text, the DXF Codes needed are:
- 0 DIMENSION
- 70 for the type of dimension
- 13, 23, 33-- defines the start point of reference line
- 14, 24, 34 -- defines the end point of reference line
- 10, 20, 30 for the point where the dimension line starts (above the end point of the ref line
To also create the dimension text at the right position and orientation:
- 11, 21, 31 -- text center position
- 1 -- dim user text
- 42 -- actual measured value , read only
Codes 50 (angle of extension line to Y axis) and 71 (attachment point are not needed)
Structure of the attached text file "_DXF Dimensions to skp.txt":
-
first there is some introduction and links to DXF dimensions
-
4 examples of dimensions from DXF with codes and values along with a ruby code snippet filling variables with the values
-
extracted DXF codes with values from the test file with comments on the lines
- Ruby code snippet to fill variables with the DXF values
-
piece of ruby code creating a dimension based on the variables set beforehand
I would be very glad, if you could implement the Dimension import!
I also have finished analysing what is needed to import the LEADERs (as SketchUp text drawing element).
If we only would want the leader line to be imported without text, as this is already being imported, then the needed DXF Codes are:- 0 LEADER
- 76 -- number of vertices in leader line
- 10, 20, 30 vertices of leader line. There are 2 or more vertices. Number indicated in Code 76
To also import the mtext into the SketchUp text object, we need in addition:
- 340 -- hard link to MTEXT or block or INSERT handle. Importing MTEXT is probably enough.
- 1 -- text from linked MTEXT entity
The structure of the attached file "_DXF Leaders to skp.txt" is same as for Dimensions.
Proposal how to import dimensions from DXF to SKP
-
@tig said:
Thanks for your work on this...
I'll look at it as soon as I have some free time and come back to you...Looking forward to it.
I added the DXF Codes for importing LEADER objects as well in above post, so that I do not loose this work. -
@TIG,
in a few weeks I am getting again drawings I need to import into Sketchup.
Do you see a chance to get the import of dimensions and leaders (Text) implemented by then?
It would really make my life easier.
Whatever I can do to help, just let me know. -
I've not had a chance to look at anything yet.
I suspect it'll be some weeks before I clear my existing workload sufficiently... -
I doubt that Sketchup is ever doing a dimension import. You are my last hope
Do you see any chance to implement it soon? -
I'm sorry but my other commitments will almost certainly mess with any significant work on this...
-
Thanks a lot for this extension!
Problem/bug:
When I try to force it to interpret a minimal dxf as being in mm, it forces me to use inches:
"Do NOT choose a unit that is less than
that set in the DXF [inches]
It's best to accept the default offered."
There is no option to proceed anyway, like there is if you choose meters instead.
Can this be fixed?
My use case is spitting out severely minimal dxf:s using different programmatic approaches. I skip header info, but it is still valid dxf. But since there's no unit info in the files, that the extension defaults to inches is a bit sad for a non-inch-using-person. -
Why strip out the unit's setting ?
Can't you leave it in ?
The 3d location of the text will be severely messed up too ??
If you can't keep that, then can you import at inches and scale the resultant objects using a factor to change from inches to mm [or whatever] - bearing in mind that the 3d location of the text objects could be well FUBAR ! -
Came across a problem where this plugin would not work for a drawing. It would try import the text from a dxf file but no text would appear in the SU model.
The ruby console showed an error "VALIDITY CHECK = Txt - invalid group".
I narrowed it down to a few Text entities which had "%%C" symbols in their text content (the diameter symbol in AutoCAD).
I changed them from "150mm%%C" to "150mm" and the import worked. Just one text with the %% means nothing in the drawing imports.Just said I would post it here in case anyone else has this issue.
-
Many special characters are trapped but a rogue %%C is not.
I'll add to an update soonest.
-
Here's v5.0
https://sketchucation.com/pluginstore?pln=importDXFtext
It fixes the recently reported glitch with certain ACAD diameter symbols in some strings...
Advertisement