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: 

Palette sample Mysteries (For me !)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Le_Bear
164 Views, 2 Replies

Palette sample Mysteries (For me !)

I just setup and installed the files found there: Fusion 360 Help | Palette Sample | Autodesk

Everything is working just as expected which is very nice and give me ideas for a plugin I have in mind.

The mystery is that, for example, I see as a title in the HTML document "Fusion 360 Palette Sample", but I can't find this string in either the .py file or the .html file.

Le_Bear_0-1704127402255.png

I also added some  css, like this:

<head>
        <style>
            body {font: normal, Verdana, Arial, sans-serif; font-size:large;}
            p    {color: rgb(38, 0, 255);}
        </style>
    </head>

but I can't see any difference in the displayed html, while I see it in VS Code (Extension HTML Preview), even after I stopped and restarted the plugin.
It would be a great help in using this feature to have those "mysteries" solved!
Happy New Year !




Bernard Grosperrin

Autodesk Certified Instructor

FaceBook Group | Forum | YouTube

Group Network Leader
 
2 REPLIES 2
Message 2 of 3
JeromeBriot
in reply to: Le_Bear

Hello,

 

This is not the code of the add-in you created.

 

The documentation can be confusing:

Edit the add-in and check the code under the resources/html folder:

 

html-palette.png

 

For the CSS, a good pratice is to use a separate file. You can add it in the resources/static folder.

 

For example style.css:

body {
    background-color: lightcyan;
}

h1 {
    color: peru;
    font-weight: bold;
}

 

Then you call this file in the <head> section of the HTML file:

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="static/style.css">
    <script type="text/javascript" src="static/palette.js"></script>
</head>

 

 You have to stop and run the add-in to see the modifications:

 

palette-css.png

 

Message 3 of 3
Le_Bear
in reply to: JeromeBriot

Thank you for your answer, Jérôme. Yes, it was confusing. I'll take the time to look at this in depth tomorrow.

Bernard Grosperrin

Autodesk Certified Instructor

FaceBook Group | Forum | YouTube

Group Network Leader
 

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report