Created
January 15, 2021 19:01
-
-
Save prantlf/4e6e5a99a94e4d605e189dc778d29760 to your computer and use it in GitHub Desktop.
How to assign a custom icon to AutoCAD drawings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/icons/images/dwg.svg: | |
The icon image content. | |
src/icons/icons.css: | |
.binf-widgets .acad-mime-dwg { | |
background-image: url('images/dwg.svg'); | |
} | |
src/icons/icons.js: | |
define([ | |
'css!acad/icons/icons' | |
], function () { | |
return [ | |
{ | |
equalsNoCase: { | |
mime_type: [ | |
'application/acad,', | |
'application/x-acad,', | |
'application/autocad_dwg,', | |
'image/x-dwg,', | |
'application/dwg,', | |
'application/x-dwg,', | |
'application/x-autocad,', | |
'image/vnd.dwg,', | |
'drawing/dwg' | |
] | |
}, | |
className: 'csui-icon acad-mime-dwg', | |
mimeType: 'AutoCAD Drawing', | |
// Take precedence over the common document icon, | |
// which has the default sequence of 100. | |
sequence: 50 | |
} | |
]; | |
}); | |
src/acad-extensions.json: | |
{ | |
"csui/utils/nodesprites": { | |
"extensions": { | |
"acad": [ | |
"acad/icons/icons" | |
] | |
} | |
}, | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment