#1
|
|||
|
|||
Transfer attibute from CAD to MM
I have read a couple of thread on this argument, but I was not able to solve the issue.
I'm able to write an attribute inside a part or group, and to use it to populate a BOM in annotation, as an example. I was trying to transfer these attributes to MM when a part is saved to DB, but I'm not able to obtain this: custom defined attributes are simply ignored, even if a dictionary with the same name already exists in MM and it is assigned to MODEL_3D and MASTERDATA. I have copied and modified a lisp that I found on the internet and it works for assigning custom attributes to a part, but not to write them to MM, may be somebody would have a look to undestand where I fail? I'm using Modeling and MM 20.0. |
#2
|
|||
|
|||
Re: Transfer attibute from CAD to MM
I made some improvements to my lisp based on the study of the integration kit and web searchs, but it still not works.
One more problem is that my XML file is a little mess, due to the fact that I cannot cancel or modify some dictionary<-->attribute association, because the contextual menu in MM (Administrator mode) does not show anything needed to redefine or delete these associatons, while it works for default associations already presents in the standard installation of MM. |
#3
|
||||
|
||||
Re: Transfer attibute from CAD to MM
I am sorry to say I currently do not really find the time to compose a detailed answer.. but this topic is still on my list. I did not forget about it!
__________________
|
#4
|
|||
|
|||
Re: Transfer attibute from CAD to MM
Quote:
No problem at all, this a users forum and not an help-desk! |
#5
|
||||
|
||||
Re: Transfer attibute from CAD to MM
finally here it goes,
1st of all you have programmed a fine and complete example of attribute handling and creating BOM data for an Annotation Bom. Well done. But this is all 'database' independent. The major key word for ModelManager Attribute together with Modeling is "user defined attribute" or in short form UDA . Have a look to the goodies. https://support.ptc.com/help/creo_el...es/Readme.html There is one goodies to be loaded Code:
(load "inq_db_uda") The second one is Code:
(load "inq_all_atts") ________________________________________________________________ "user defined attributes" as mandatory for ModelManager are based on 'item-attributes' functionality, but do have special behaviour in addtition. Major function is: Code:
sd-define-db-attribute Have a look here: https://support.ptc.com/help/creo_el...ce/db_uda.html where also a bunch of other db-attribute functions are documented. To reflect those attributes in your structure browser there are 5 functions named sd-create-uda-<valuetype>-column-definition to be used. I recommend, you will start with ONE attribute and explore the new functions before extending your code to 15 attributes ;-) You can also inspect and manipulate UDAs with the item-attributes functions. Sorry for the long delay.
__________________
Last edited by Wolfgang; 11-20-2022 at 05:45 AM. |
#6
|
||||
|
||||
Re: Transfer attibute from CAD to MM
Quote:
Instead of coding each and every detail for all of you 12 Attributes, I defined one Generic function and do call it 12 times with the attribute name as parameter. This saves you (in your original approach) around 120 lines of code to be maintained over time. It was shrinked to just 17 lines. May be this gives you a little inspiration in addition. 😏
__________________
|
#7
|
|||
|
|||
Re: Transfer attibute from CAD to MM
Quote:
Hi Wofgang, thank you for time and patience! To be honest I'm not the creator of that file: I just found something somewhere in the internet and adapted it to my needs. Actually I was aware of that page(s) of the user manual, and I tried to apply them, but without success. I have this section in my lisp file: Code:
(oli::sd-define-db-attribute "TEST" :class-name "MASTERDATA" :attachment :contents :keys '(("TEST" :label "TEST")) :allowed-owner-types '(:part :assembly) :master :all :filing '(:db :sd-file) :on-copy :copy :on-merge :detach :on-split :copy :command-name 'set_attribute) Code:
Instance Attributes ---------------------------- ---------------------------- Contents Attributes ---------------------------- (MY_SPECIAL_BOM_ATTR) :FILING = :SD-FILE :ON-COPY = :COPY :ON-XFORM = :MAINTAIN :ON-SYSID-CHANGE = :MAINTAIN :ON-MERGE = :MAINTAIN :ON-SPLIT = :COPY :FILING = :DB :MATERIALE = " - " :AUT_REV = = NIL :DATA = = NIL :CODICE = = NIL :N_REV = "0" :DESCR_REV = = NIL :TRATTAMENTO = = NIL :COMMESSA = " - " :DENOMINAZIONE_AGG = = NIL :TEST = "STI-AM" :DATA_REV = = NIL :DENOMINAZIONE = "/p07" :DISEGNATORE = = NIL :CLASSE = "P" (DB-GREF) :FILING = :MI-FILE :FILING = :SD-FILE :ON-COPY = :MAINTAIN :ON-XFORM = :MAINTAIN :ON-SYSID-CHANGE = :MAINTAIN :ON-MERGE = :DETACH :ON-SPLIT = :MAINTAIN :MM_STATUS = "-2" :MM_STATUS_TEXT = "Nuovo" Code:
---------------------------- Part/Assy = /p06 ---------------------------- 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 :VERSION = "-" :ELID = "DIYQMGMHHXTZXA" :UNIQUE_ID_STRING = "_-_F000238: [-] in_lavoraz" :CLASS_NAME = "MASTERDATA" :NAME = "_-_F000238" :CLASS_TYPE = "$PARTDESC" :CREATE_DATE = "2022/11/22 22:05:46 +0100" (DB-DREF) :FILING = :MI-FILE :FILING = :SD-FILE :ON-COPY = :MAINTAIN :ON-XFORM = :MAINTAIN :ON-SYSID-CHANGE = :MAINTAIN :ON-MERGE = :DETACH :ON-SPLIT = :MAINTAIN :MODEL_ID = "272992-1669147179-ec8eb5966ce4-0 2056" :VERSION = "1" :ELID = "DIYQMGM7HXTZXA" :UNIQUE_ID_STRING = "p06: [1] in_lavoraz" :CLASS_NAME = "MODEL_3D" :NAME = "_-_F000238" :INSTANCE_NAME = "p06" :CREATE_DATE = "2022/11/22 22:05:46 +0100" :CLASS_TYPE = "$DOC" (DB-GREF) :FILING = :MI-FILE :FILING = :SD-FILE :ON-COPY = :MAINTAIN :ON-XFORM = :MAINTAIN :ON-SYSID-CHANGE = :MAINTAIN :ON-MERGE = :DETACH :ON-SPLIT = :MAINTAIN :INSEPARABLE = "0" :MM_STATUS = "1" :FILETYPE = "Model.SD" :IN_PACKET_DMS_NAME = "Alessandro Marchetti" "RelatedFile0" = "B1.SD.sd_gfx" "PL_ObjectType" = "npart3-contents" :PL_BASETYPE = "P" :MM_STATUS_TEXT = "Aggiornato" (MY_SPECIAL_BOM_ATTR) :FILING = :SD-FILE :ON-COPY = :COPY :ON-XFORM = :MAINTAIN :ON-SYSID-CHANGE = :MAINTAIN :ON-MERGE = :MAINTAIN :ON-SPLIT = :COPY :FILING = :DB :MATERIALE = " - " :AUT_REV = = NIL :DATA = = NIL :CODICE = = NIL :N_REV = "0" :DESCR_REV = = NIL :TRATTAMENTO = = NIL :COMMESSA = " - " :DENOMINAZIONE_AGG = "Albero" :TEST = "STI-AM" :DATA_REV = = NIL :DENOMINAZIONE = "/p06" :DISEGNATORE = = NIL :CLASSE = "P" I guess that my "sd-define-attribute" instruction contains one or more errors, but I'm not able to find them. This is the output of the inq-db-uda command: Code:
----------------------- DB UDA Personalities ----------------------- [Distinta Base] Command = MM_ASSIGN_BOM Auto Cmd = NIL Offer Defaults = NIL Icon = bitmaps/bmp/commands/MoldBaseAdvisor/bom.bmp Category = /Predefiniti ----------------------- DB UDA Definitions ----------------------- [bom-reference] Classtype = LINK Classname = INSTANCE_LINK Command = NIL Keys = (BOM_REFERENCE) Owners = PART-ASSEMBLY Attachment = INSTANCE Master = OSD [bom-indicator] Classtype = DOC Classname = _MODEL Command = NIL Keys = (BOM_INDICATOR) Owners = ASSEMBLY Attachment = CONTENTS Master = ALL [bom-quantities] Classtype = DOC Classname = _MODEL Command = NIL Keys = (_LINK_OVERWRITES _LINK_SPARES) Owners = ASSEMBLY Attachment = CONTENTS Master = ALL |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|