Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

DXF Import utility - extrude problem

damien.huvelle
Enthusiast

DXF Import utility - extrude problem

damien.huvelle
Enthusiast
Enthusiast

Hi everyone, 

I'm having some troubles with the addin, when I bulk import DXFs and choose to automatically extrude them with the addin it always hide the sketch after extruding. I need to keep all the sketches visible (I import a lot of DXF in one project and I can't spend my time to manually unhide all the sketches. It is more than 100 dxf per project).

 

I have unchecked in my preferences the "auto hide sketches on feature" so it's not that. even after restarting fusion it doesn't work.

 

thanks for you help.

 

@prainsberry @kandennti 

0 Likes
Reply
Accepted solutions (2)
1,028 Views
7 Replies
Replies (7)

kandennti
Mentor
Mentor
Accepted solution

Hi @damien.huvelle .

 

I think you are talking about this add-in.

https://apps.autodesk.com/FUSION/ja/Detail/Index?id=3146198746757677787&appLang=en&os=Win64 

 

Since I can't change the add-in, I made a script to show/hide all sketches.

# Fusion360API Python script
import adsk.core, adsk.fusion, traceback

def run(context):
    ui = adsk.core.UserInterface.cast(None)
    try:
        app :adsk.fusion.Application = adsk.core.Application.get()
        ui = app.userInterface

        # get all sketch
        skts = getAllSketch(app.activeProduct)

        if len(skts) < 1:
            ui.messageBox('There are no sketches.')
            return

        # query
        msg = f'Show/Hide all sketches. (Sketch count {len(skts)})\n\n'
        msg += 'Yes : All Show\nNo : All Hide\nCancel : Cancel'
        query = ui.messageBox(
            msg,
            '',
            adsk.core.MessageBoxButtonTypes.YesNoCancelButtonType,
            adsk.core.MessageBoxIconTypes.QuestionIconType)

        # exec
        if query == adsk.core.DialogResults.DialogYes:
            setLightBulbOn(skts, True)
        elif query == adsk.core.DialogResults.DialogNo:
            setLightBulbOn(skts, False)

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def setLightBulbOn(skts :list, value :bool):
    for skt in skts:
        skt.isLightBulbOn = value

def getAllSketch(des :adsk.fusion.Design) -> list:

    lst = []
    for comp in des.allComponents:
        lst.extend([skt for skt in comp.sketches])

    return lst


Someone else may have made a more useful add-in.

0 Likes

damien.huvelle
Enthusiast
Enthusiast

Hi, thank you for taking the time to make all this.

maybe I would be able to add this to the add-in ?

I will try all this as soon as possible or just run this script as a standalone if I can’t achieve what I want.

thanks a lot

maybe the addin could be modified by the author to add this ? @prainsberry 

0 Likes

prainsberry
Autodesk
Autodesk

Hey sorry for being late to this conversation.  That script is great.  I'm not sure why the sketches are still hiding if you have that option set.   I think I could fairly easily add that as an option to the app.  But getting it re-published to the store will take a little time.  I'll post back here when I get it integrated.  That script should work also for immediate results.

 



Patrick Rainsberry
Developer Advocate, Fusion 360
1 Like

prainsberry
Autodesk
Autodesk
Accepted solution

I made the change to add this as an option.  Going to make a few more small changes before going through the submission process again.  But you can get the latest with the change here:
https://github.com/tapnair/DXFImporter/raw/master/build/__LATEST__/DXFImporter.zip

 



Patrick Rainsberry
Developer Advocate, Fusion 360
1 Like

damien.huvelle
Enthusiast
Enthusiast

@prainsberry

it works fine thank you !

just one little thing that can also be usefull. I see in files of the add-in that it may be possible to change the way that "extrude"works (largest profil, profil with bigger holes numbers). In my case I have DXF files with different layers an the first one is always the profil of the piece the others are some drilling.

How and where, can I only have the first layer extrude (the largest) and not the others ?

 

I have tried several changes in the "code" to enable or disable the "largest profil" and "profil with bigger number of holes" but never achieved to make it change anything (but the add-in kept working ...)

0 Likes

justin3EE5F
Community Visitor
Community Visitor

Am I missing something or is the DXF import utility unavailable now?  I am trying the manufacturing extension to nest customer DXF files for our waterjet but cant seem to find this utility or something similar.   Any suggestions? 

0 Likes

BrianEkins
Mentor
Mentor

The DXF Import Utility is no longer on the App Store, but you can download the source from GitHub. It is dependent on a DXF library. A while ago, when Fusion updated the Python library, the utility was broken because it needed to be updated along with the DXF utility it used. The update never happened, so it was pulled from the store. But, it shouldn't be too big of a deal to get the latest version of the DXF library and add-in source from GitHub and get it working.

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes