| |
 | Gut zu wissen: Hilfreiche Tipps und Tricks aus der Praxis prägnant, und auf den Punkt gebracht für Creo |
| |
 | Effektives Anforderungsmanagement und agile Entwicklung, eine Pressemitteilung
|
Autor
|
Thema: [English] read part property (1580 mal gelesen)
|
cacciatorino Mitglied

 Beiträge: 49 Registriert: 15.01.2008 Solid Edge ST10 Win10-64 Modeling V20.5 Win10-64 Salome 9.1
|
erstellt am: 12. Apr. 2015 18:24 <-- editieren / zitieren --> Unities abgeben:         
Hallo to all! I have an assembly that belongs to my customer. Parts and subassembly have metadata written in the model, so I'm trying to use them to create my BOM list to be inserted in Annotation. I have two kind of property in each file: the first ones have the symbols ":" as pre-text before the property name, the second ones have the property name written inside commas: Code: ---------------------------- Part/Assy = /g1/VITE_UNI5739_M16x65.2.1.1.4.1 ---------------------------- Instance Attributes ---------------------------- ---------------------------- Contents Attributes ---------------------------- (DB-PREF) :FILING = :MI-FILE :FILING = :SD-FILE :ON-COPY = :MAINTAIN :ON-XFORM = :MAINTAIN :ON-SYSID-CHANGE = :MAINTAIN :ON-MERGE = :DETACH :ON-SPLIT = :MAINTAIN "isi_stato_cod" = "3" "isi_codice" = "K270445" "isi_data_stato" = "2006/11/20 13:43:10 +01:00" :ELID = "61400" "isi_data_aggiornamento" = "2012/07/20 16:26:03 +02:00" :UNIQUE_ID_STRING = "K270445" :RICAMBIO = "-" :VERSION = "0" "id_elemento" = "61400" "isi_descrizione" = "VITE_UNI5739_M16x65" etc etc .. ..
I modified the macro provided in the on-line help, as follows: Code: (defun bomattr-get-descrizione (selitem) (let ((attr (sd-inq-item-attribute selitem "DB-PREF" :values :attachment :contents))) (if attr (getf attr :DENOMINAZIONE) nil) ) )
I was able to read the property of type :SOMETHING = "value" and insert it in my BOM, but I cannot find the way to read the property of type "something_else" = "other value". Any help to obtain this? [Diese Nachricht wurde von cacciatorino am 12. Apr. 2015 editiert.] Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
cacciatorino Mitglied

 Beiträge: 49 Registriert: 15.01.2008 Solid Edge ST10 Win10-64 Modeling V20.5 Win10-64 Salome 9.1
|
erstellt am: 12. Apr. 2015 18:42 <-- editieren / zitieren --> Unities abgeben:         
|
AlexG Mitglied
 
 Beiträge: 133 Registriert: 05.04.2013 Win7 64-bit; Intel Core i7, 8CPUs @ 2,2GHz; 16GB RAM; 120GB SSD; Nvidia Quadro 1000 M; SolidDesigner 18.0
|
erstellt am: 13. Apr. 2015 14:30 <-- editieren / zitieren --> Unities abgeben:          Nur für cacciatorino
Hi, it's possible for me to reproduce this problem. The result of sd-inq-item-attribute seems only to be partly a plist. All attributes using keywords are working as expected, but if the designator is a string it's not working and the value can't be inquiered...weired. Here is a quick and dirty workaround, which works for me: Code: (let* ( (id-element-attrib (sd-inq-item-attribute selitem "DB-PREF" '("id_elemento") :attachment :contents)) (id-element-designator (first id-element-attrib)) (id-element-value (second id-element-attrib))) (display id-element-value) )
Just for giving an inspiration: For copying attributes have look at sd-attach-item-attribute... Best regards, Alex ------------------ Computer sind unbrauchbar. Sie können nur Fragen beantworten. Pablo Picasso, Maler Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |

| |
cacciatorino Mitglied

 Beiträge: 49 Registriert: 15.01.2008 Solid Edge ST10 Win10-64 Modeling V20.5 Win10-64 Salome 9.1
|
erstellt am: 14. Apr. 2015 09:20 <-- editieren / zitieren --> Unities abgeben:         
Thank you very much for the valuable feedback, finally I got somethign working using this lisp: Code:
... ... (defun bomattr-get-isi_descrizione (selitem) (setf isi_descrizione (sd-inq-item-attribute selitem "DB-DREF" "isi_descrizione" :attachment :contents) ) ) ... ...
Bests regards, Alessandro. [Diese Nachricht wurde von cacciatorino am 14. Apr. 2015 editiert.] Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |