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: 

Directory structure, appropriate logs output directory, logs collection

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
jacob.r.jennings
334 Views, 3 Replies

Directory structure, appropriate logs output directory, logs collection

When developing an AddIn in c++, where should I place logs files so they are included when collecting diagnostic logs via user-facing instructions: https://knowledge.autodesk.com/support/fusion-360/troubleshooting/caas/sfdcarticles/sfdcarticles/How... ?

 

Can I get this directory via Application or UserInterface?

 

I believe a correct path might look like /Users/jakej/Library/Application Support/Autodesk/Autodesk Fusion 360/792RRXXHW5PV/logs

 

What does the UUID (792RRXXHW5PV in the path above) represent, a user? 

Tags (3)
3 REPLIES 3
Message 2 of 4

Hello,


@jacob.r.jennings wrote:

What does the UUID (792RRXXHW5PV in the path above) represent, a user? 


This is the User ID:

import adsk.core, traceback

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

        user = app.currentUser

        ui.messageBox('{}\n{}\n{}\n{}'.format(user.displayName, user.email, user.userId, user.userName))

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

 

Tags (4)
Message 3 of 4

It's good to know that directory represents the user. But, I still don't know where to place logs which may be collected by users during diagnostics

Message 4 of 4

On Windows: C:\Users\<UserName>\AppData\Roaming

On Mac: /Users/<UserName>/Library/Application Support

 

Here is a code in Python to manage these folders:

 

import os
import platform

def getUserPreferencesFolder():

    app = adsk.core.Application.get()

    preferencesPath = getPreferencesFolder()

    if not os.path.exists(preferencesPath):
        os.mkdir(preferencesPath)

    userPreferencesPath = os.path.join(preferencesPath, app.userId)

    if not os.path.exists(userPreferencesPath):
        os.mkdir(userPreferencesPath)

    return userPreferencesPath


def getPreferencesFolder():

    if platform.system() == 'Windows':
        preferencesPath = os.path.join(os.getenv('APPDATA'), '<YourAddinName>')
    else:
        preferencesPath = os.path.join(os.path.expanduser('~'), 'Library', 'Application Support', '<YourAddinName>')

    return preferencesPath

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report