Hi, first time posting on the forums. I hope somebody has a solution to this problem.
For my work we use a lot of standard components that have dynamic components attributes so you can select the fixings required. For example on a certain bracket we use a drop down list to select ‘M12 x50mm bolt’. We then use the ‘generate report’ feature to collate the total number of bolts etc. required for the project.
The problem occurs when we design bespoke brackets in Solidworks and import them as STLs. It takes too much time to add dynamic component attributes manually to each one.
Is there a plugin or some ruby script to mass add a group of attributes to a component easily? They would be the same attributes every time.
It would be great to hear if someone has a solution to this!
Hello
I have developed and shared a plugin named SJ Add DC Attribute.
It allows you to create, copy attributes of dynamic components from a list of favorites or from a source component.
You can consult the documentation and download it on my website https://sketchup.simjoubert.com/my-plugins/sj-add-dc-attribute.html
Thanks for your reply Simon. Your plugin is exactly what I was after! Thanks so much for developing that.
Just a couple of suggestions/questions:
Would it be possible to select all ‘favorite’ attributes so that you can add them in one go, rather than clicking add individually.? (I’ve got 10+ attributes to add)
Is it possible to save favorite attributes so they transfer between skp models?
You need to tell me a little more so that I can help you.
To work, the plugin needs components to be selected before launching the plugin.
Has the plugin ever worked on your installation or is it bugged only for this session? This model ? This component?
Version 3.2 does not support being installed in a folder other than the standard SketchUp plugins folder. The next version will fix this
this is the first running of your extension. I just installed it using the Extension Manager.
Yes, I select a component firstly, then push the component’s button.
`**************************************************************
***************************** CONSOLE AD DC Attribut *********
**************************************************************
SELECTION COLLECTION
collection = [#<Sketchup::ComponentInstance:0x000000013b2953d8>]
***************************** START AD DC Attribut *********
COLLECTE
L'unité du modèle length_units = "INCHES"
Collecte des définitions dans la sélection => listeAttributsDefinitions = "[{\"name\":\"СБ:Стойка угловая\",\"attributs\":[{\"label\":\"onClick\",\"state1\":3,\"name\":\"onclick\",\"formulaunits\":\"STRING\",\"value\":\"ANIMATE(\\\"RotZ\\\",0,90,180,270)\"}]}]"
Collecte des favoris => listeAttributsFavoris = []
Collecte des préférences d'affichages des infobulles => preferenceInfobulle = true
Initialisation de la liste des attributs => listeAttributs = []
On récupère la langue de Sketchup => langue = "ru"
# L'unité du modèle => length_units = "INCHES"
INITIALISTAION DE LA BOITE DE DIALOGUE
# Javascript à exécuter une fois la boîte de dialogue affichée =>
js = "Simjoubert.listeAttributsDefinitions = [{\"name\":\"СБ:Стойка угловая\",\"attributs\":[{\"label\":\"onClick\",\"state1\":3,\"name\":\"onclick\",\"formulaunits\":\"STRING\",\"value\":\"ANIMATE(\\\"RotZ\\\",0,90,180,270)\"}]}];\n Simjoubert.listeAttributsFavoris = [];\n Simjoubert.listeAttributs = [] ;\n Simjoubert.version = '0.3.3';\n Simjoubert.showtooltips = true;\n Simjoubert.lenght_units = '';\n Simjoubert.traduction('ru');"
# URL du fichier HTML => url = "/Users/ivan/Library/Application Support/SketchUp 2022/SketchUp/Plugins/sj_Add_DC_Attribute/html/DialogueAddDCAttribut.html"
OUVERTURE BOITE DE DIALOGUE
`
Hello Ivan
Have you tried on a selection with another component, another component in another model?
Do you have several open models?
The report looks correct!
Can you check if the HTML file whose URL appears in the report exists on your machine.
Hello!
Yes, I tried with another components in different models. - the same.
I tried with only one simple new model.
Yes, it has HTML file on those folders.
Good evening Ivan
I can’t figure out what’s wrong.
I suggest you uninstall and reinstall the plugin with a reboot in between.
The other buttons on the toolbar are other features that are still in testing and not released
Not 100% sure if this is the problem, but I know when I am working with Dynamic Components that are inserted in from outside the active drawing, they are placed in a Component Container. In order to edit the DC you need to either go into the “Insert Container”, or Explode the “Insert Container” to have your DC is the first level of selection.