I have an .stl file that I want to turn into a solid

I have an .stl file that I want to turn into a solid

redondelosCRREA
Participant Participant
266 Views
3 Replies
Message 1 of 4

I have an .stl file that I want to turn into a solid

redondelosCRREA
Participant
Participant

I have used the Mesh Enabler add-in to try and convert an .stl object into a solid that I can scale. However, all I get is a mesh feature that I cannot do basically anything with it. Is there a way to turn it into a solid .ipt or .stp object?

 

I attach both the .stl file and the converted-with Mesh Enabler file.

 

PD.: It would be useful if I could do this either in Inventor or Fusion360.

0 Likes
267 Views
3 Replies
Replies (3)
Message 2 of 4

Stakin
Collaborator
Collaborator
Sub ImportFunc()
    ' Set STL translator's CLSID and STL file name.
    Dim strCLSID As String
    Dim strFileName As String
    strCLSld = "{81CA7D27-2DBE-4058-8188-9136F85FC859}"
    strFileName = "C:\Part1.stl"
      
    Dim oAddIns As ApplicationAddIns
    Set oAddIns = ThisApplication.ApplicationAddIns
    
    ' Find the Rhino translator, get the CLSID and activate it.
    Dim oTransAddIn As TranslatorAddIn
    Set oTransAddIn = oAddIns.ItemById(strCLSld)
    oTransAddIn.Activate
    
    ' Get the transient object and take it as a factory to produce other objects
    Dim transientObj As TransientObjects
    Set transientObj = ThisApplication.TransientObjects
    
    ' Prepare the first parameter for Open(), the file name
    Dim file As DataMedium
    Set file = transientObj.CreateDataMedium
    file.FileName = strFileName
    
    ' Prepare the second parameter for Open(), the open type.
    Dim context As TranslationContext
    Set context = transientObj.CreateTranslationContext
    context.Type = kDataDropIOMechanism
    
    ' Prepare the 3rd parameter for Open(), the options.
    Dim options As NameValueMap
    Set options = transientObj.CreateNameValueMap
    options.Value("SaveComponentDuringLoad") = False
    options.Value("SaveLocationIndex") = 0
    options.Value("ComponentDestFolder") = ""
    options.Value("ImportUnit") = 1
    options.Value("ImportColor") = True
    options.Value("ImportColorIndex") = 0
    
    ' Prepare the fourth parameter for Open(), the final document.
    Dim sourceObj As Object
    
    ' Open the STL file.
    oTransAddIn.Open file, context, options, sourceObj
End Sub
0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor

Just dropping the Link in here to the Inventor API online help 'Sample' documentation for this, called "Open an STL file using the STL Translator Sample".

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ImportSTLslator_Sample 

But just so you know, that example is in VBA, not iLogic or vb.net, and is designed for use from Inventor, not Fusion 360.

If you need it in a different programming language, such as for use in an iLogic rule, just let us know.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

jjstr8
Collaborator
Collaborator

@redondelosCRREA - I'm not seeing any attachments. You should be able to right-click on the mesh feature and Convert to Base Feature

jjstr8_1-1747070940706.png

After that, you can do a Direct Edit to scale, move, or rotate.

 

jjstr8_0-1747070860814.png

 

0 Likes