Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DXF Import utility - extrude problem

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
damien.huvelle
847 Views, 7 Replies

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

DXF Import utility - extrude problem

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 

7 REPLIES 7
Message 2 of 8
kandennti
in reply to: damien.huvelle

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

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.

Message 3 of 8

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

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 

Message 4 of 8

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

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
Message 5 of 8

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

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
Message 6 of 8

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

@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 ...)

Message 7 of 8

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

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? 

Message 8 of 8
BrianEkins
in reply to: damien.huvelle

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

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

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

Post to forums  

Autodesk Design & Make Report