Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cutting Text

26 REPLIES 26
Reply
Message 1 of 27
Anonymous
6376 Views, 26 Replies

Cutting Text

I need to have text, laser cut out of a sheet metal part. How can I introduce text onto a sketch that IV11 can recognize as a consumable for cutting on the part without having to redraw each letter myself ?
26 REPLIES 26
Message 21 of 27
Anonymous
in reply to: Anonymous

Our laser is old, my computer is new.

So that's why the production manager climbs up my *** when I send down files the NC guy has to massage all day with his ancient tools.
Flat pattern > to .dwg> clean it up in ACAD> then send to NC. and make sure there are NO splines if you want a part that looks right.

My reply of "buy a new laser" doesn't fly with accounting and since IV flat patterns are full of "junk", I get to massage everything like the CAD god I am.

Not everything can be solved with platitudes and purchases. Gasp, I might have to use 2 or 3 year old technology for a while longer...
Message 22 of 27
Anonymous
in reply to: Anonymous

I did find an issue with my previous macro. It expected that the only thing
in the sketch would be text. If you have the auto project edges setting
turned on, you'll also get the edges of the face and that causes it
problems. I've made a modification so that it doesn't matter now and it
will only use the text that's in the sketch and ignore everything else.

This macro won't work in Inventor 10. I takes advantage of a capability in
the API that was introduced in Inventor 11.

Here's the updated macro:

Public Sub ExplodeText()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

On Error Resume Next
Dim oSketch As PlanarSketch
Set oSketch = oDoc.SelectSet.Item(1)
If Err Then
MsgBox "A sketch must be selected when running this macro."
Exit Sub
End If

On Error GoTo ErrorFound

Dim oTrans As Transaction
Set oTrans = ThisApplication.TransactionManager.StartTransaction(oDoc,
"Explode Text")

oSketch.SetEndOfPart True
Dim oSketchEnt As Face
Set oSketchEnt = oSketch.PlanarEntity
Dim lKeyContext As Long
lKeyContext = oDoc.ReferenceKeyManager.CreateKeyContext
Dim abtSketchFaceRefKey() As Byte
Call oSketchEnt.GetReferenceKey(abtSketchFaceRefKey, lKeyContext)
Call oDoc.ComponentDefinition.SetEndOfPartToTopOrBottom(False)

Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid

' Remove any non-text profile paths from the profile
Dim oPath As ProfilePath
For Each oPath In oProfile
If Not oPath.TextBoxPath Then
oPath.Delete
End If
Next

Dim oExtrude As ExtrudeFeature
Set oExtrude =
oDoc.ComponentDefinition.Features.ExtrudeFeatures.AddByDistanceExtent( _
oProfile, 0.1,
kPositiveExtentDirection, kJoinOperation)

Dim oResult As Object
Set oResult =
oDoc.ReferenceKeyManager.BindKeyToObject(abtSketchFaceRefKey, lKeyContext)
If TypeOf oResult Is ObjectCollection Then
Set oSketchEnt = oResult.Item(1)
Else
Set oSketchEnt = oResult
End If

Dim oNewSketch As PlanarSketch
Set oNewSketch = oDoc.ComponentDefinition.Sketches.Add(oSketchEnt)
oNewSketch.DeferUpdates = True

Dim oFace As Face
For Each oFace In oExtrude.EndFaces
Dim oEdge As Edge
For Each oEdge In oFace.Edges
ThisApplication.StatusBarText = "Processing Text Curves..."
Dim oEnt As SketchEntity
Set oEnt = oNewSketch.AddByProjectingEntity(oEdge)
oEnt.Reference = False
Next
Next

Call oExtrude.Delete(True, False)

oNewSketch.DeferUpdates = False
oTrans.End
Exit Sub

ErrorFound:
oTrans.Abort
MsgBox "Unexpected error while exploding text."
End Sub

--
Brian Ekins
Autodesk Inventor API


wrote in message news:5204368@discussion.autodesk.com...
not working in either 10 or 11. perhaps its something to do with how I
copied in the macro, I dunno.

here's my file:
Message 23 of 27
Anonymous
in reply to: Anonymous

Brian,

thanks very much for writing that up. It serves as a handy way to get from sketch text to sketch geometry... but with curved text I get the same output as when I extrude the sketch text itself. Maybe it would work better on a font with only simple curves?

I think the best solution remains to make a custom font for sketch text that has no curves in it.

-barrett
Message 24 of 27
Anonymous
in reply to: Anonymous

The definition of the text within the TrueType front uses curves so that's
what we output. Another alternative is to approximate any curves with
lines. I don't think it would be too difficult to modify the program to do
this. If that would be useful I can take a look at it when I get some time.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205703@discussion.autodesk.com...
Brian,

thanks very much for writing that up. It serves as a handy way to get from
sketch text to sketch geometry... but with curved text I get the same output
as when I extrude the sketch text itself. Maybe it would work better on a
font with only simple curves?

I think the best solution remains to make a custom font for sketch text that
has no curves in it.

-barrett
Message 25 of 27
Anonymous
in reply to: Anonymous

would approximating curves with lines output hundreds of segments? because that is what is happening when we save to dxf. I see that the curves from the text are several curves (when selected in IV), but these become very large polylines (?) when taken into autocad.

what I think is happening (and im not very strong in autocad, so excuse me if I get the terms wrong) is that the curves in the font definition come in much the same way as splines do. (IV is turning the TT font into a collection of splines?). This happens for any curve in the font whether its a simple curve or a complex one, which is why my basic solution has been to make a TT font with no curves.

if you can approximate curves as lines and maybe arcs that can simplify the dxf, that would be SUPER.
Message 26 of 27
Anonymous
in reply to: Anonymous

Simplifying a curve with lines is easy but the downside is that there will
be a bunch of segments. Approximating the curves with arcs is a much more
difficult proposition. Not something that I'll likely have the time to
invest in the near term.
--
Brian Ekins
Autodesk Inventor API


wrote in message news:5206271@discussion.autodesk.com...
would approximating curves with lines output hundreds of segments? because
that is what is happening when we save to dxf. I see that the curves from
the text are several curves (when selected in IV), but these become very
large polylines (?) when taken into autocad.

what I think is happening (and im not very strong in autocad, so excuse me
if I get the terms wrong) is that the curves in the font definition come in
much the same way as splines do. (IV is turning the TT font into a
collection of splines?). This happens for any curve in the font whether its
a simple curve or a complex one, which is why my basic solution has been to
make a TT font with no curves.

if you can approximate curves as lines and maybe arcs that can simplify the
dxf, that would be SUPER.
Message 27 of 27
Anonymous
in reply to: Anonymous

>>Simplifying a curve with lines is easy but the downside is that there
>>will be a bunch of segments. Approximating the curves with arcs is
>>much more difficult proposition. Not something that I'll likely have the
>>time to invest in the near term.

Well what im saying is that this is already what we get when the extruded text is saved to a dxf - the splines are converted to a nasty huge polyline (~500kb for "358"). I don't see how exploding the splines in inventor before saving to dxf makes a difference, unless that opens up other possibilities. what would be great for me (and for most) would be some function to cut down the resolution of the TT conversion, so instead of a 50 part polyline, we wind up with, say, 5.

I would like to point out that the export planar geometry add-in that I keep mentioning saves to dxf with different settings that IV10 normally does. I consistently get dxf files that are 20 percent or so smaller with that add in compared to saving from a flat or saving from an idw. I wonder what the difference is?

-barrett

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report