CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > Annotation

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-08-2015, 12:11 AM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Edit and sort BOM table

Hi all

There is a way to sort BOM table by part code?
And a way to edit it?
I'm using OSD without MM

Thanks a lot!
Reply With Quote
  #2  
Old 10-15-2015, 11:33 AM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Edit and sort BOM table

up........
Reply With Quote
  #3  
Old 10-23-2015, 05:41 AM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Edit and sort BOM table

Someone can help me?
Reply With Quote
  #4  
Old 12-12-2015, 04:06 AM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Edit and sort BOM table

up........
Reply With Quote
  #5  
Old 12-15-2015, 01:20 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Edit and sort BOM table

I'm afraid not... the BOM table functionality is fairly limited.
Jaap
Reply With Quote
  #6  
Old 01-03-2016, 11:21 PM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: Edit and sort BOM table

Shaba,
thi is my code to sort the BOM by "codice", "fornitore" and "tipo".
the result in the attachment.

Code:
(defun ordinaBOM ()
    (sd-hide-display-table "AM-BOM-DATA-DTAB")

    (AM_BOM_NUMBERS :clear)  ;azzera tutte le posizioni
    (setq ltab (sd-get-display-table-logical-table "AM-BOM-DATA-DTAB"))
    (setq row-number (sd-get-logical-table-number-of-rows ltab))
    (setq i 0)
    (loop
	(setq POS_NO           (sd-Read-logical-table-cell ltab :row 0 :column :DOCU_BOM_POS_NO))
	(when (sd-string/= POS_NO "") (return) )

	(setq rowtableDB       (sd-read-logical-table-row ltab :row 0))
	(setq ENTRY_ID         (sd-Read-logical-table-cell ltab :row 0 :column :DOCU_BOM_ENTRY_ID )) 

	 (setq lengrow (length rowtableDB))
	 (dotimes (j lengrow)
		  (if (string= (nth j rowtableDB) ":PART_CODE ")                     (setq CODICE           (nth (+ j 1) rowtableDB)))
		  (if (string= (nth j rowtableDB) ":bom3d-Fornitore-attr-cont ")     (setq FORNITORE        (nth (+ j 1) rowtableDB)))
		  (if (string= (nth j rowtableDB) ":bom3d-classe-merc-attr-cont ")   (setq TIPO             (nth (+ j 1) rowtableDB)))
      ) 
	  (if (not FORNITORE) (setq FORNITORE ""))

         
          (COND 
            ((OR (and  (sd-string/= (sd-string-trim FORNITORE) "") (sd-string= (sd-string-trim Tipo) "XXX"))       
                 (sd-string= (sd-string-trim Tipo) "COM") )                                                    (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "A ~a~a~a" (SD-STRING-UPCASE (sd-string-trim FORNITORE))   (SD-STRING-UPCASE (sd-string-trim CODICE)) i )))  
            ((AND (sd-string/= (sd-string-trim CODICE) "") (sd-string= (sd-string-trim Tipo) "MEC"))           (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "C ~a" CODICE)))	
            (T 												       (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "X ~a" i )))
;           (T 											       	       (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "D ~a~a~a" (SD-STRING-UPCASE (sd-string-trim DESCRIZIONE)) (SD-STRING-UPCASE (sd-string-trim PARTE)) i )))            
          ) ;COND

    (incf i)
    ) ;endloop
    
    (AM_BOM_NUMBERS :by_step :on :by_step_start 1 :by_step_incr 1)

    (setq i (- row-number 1))
    (loop
        (when (< i 0) (return) )
	 (DISPLAY (format nil "~A gia' presente!" CODICE))
         (setq POS_NO           (sd-Read-logical-table-cell ltab :row i :column :DOCU_BOM_POS_NO))
         (setq ENTRY_ID         (sd-Read-logical-table-cell ltab :row i :column :DOCU_BOM_ENTRY_ID ))         

 	 (setq rowtableDB  (sd-read-logical-table-row ltab :row i))

	 (setq lengrow (length rowtableDB))
	 (dotimes (j lengrow)
		  (if (string= (nth j rowtableDB) ":PART_CODE ")                     (setq CODICE           (nth (+ j 1) rowtableDB)))
		  (if (string= (nth j rowtableDB) ":bom3d-Fornitore-attr-cont ")     (setq FORNITORE        (nth (+ j 1) rowtableDB)))
		  (if (string= (nth j rowtableDB) ":bom3d-classe-merc-attr-cont ")   (setq TIPO             (nth (+ j 1) rowtableDB)))
      )
      (if (not FORNITORE) (setq FORNITORE ""))	  
     
          (COND 
            ((sd-string= (sd-string-trim Tipo) "ASS")                         (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "~a" CODICE)))	
            ((AND (sd-string= (sd-string-trim FORNITORE) "") 
            		(sd-string/= (sd-string-trim Tipo) "MEC"))            (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "X~a" POS_NO)))
            ((sd-string= (sd-string-trim Tipo) "MEC")                         (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "~a" CODICE)))	
          ) ;COND

        (decf i)
    )

    (display :clear-hide)

)
Attached Thumbnails
Click image for larger version

Name:	bom.jpg
Views:	691
Size:	157.4 KB
ID:	1929  
Reply With Quote
  #7  
Old 01-04-2016, 04:19 AM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Edit and sort BOM table

Thank you!
But it give me error
"La variabile FORNITORE non è associata"
I think it missing some macro
Thank you!

Sono anche io dall'Italia!
Secondo me mancano delle altre macro per funzionare
Hai qualche personalizzazioni su cui gira OSD?
Come fai a far comparire quella tabella?

Grazie
Reply With Quote
  #8  
Old 01-10-2016, 03:14 PM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: Edit and sort BOM table

Ciao,
devi personalizzare il codice con i tuoi campi, questo è solo un esempio di come ho lavorato per ordinare la tabella.
Posso aiutarti se mi mandi l'esportato in excel della tua tabella DB.

You must customize the lisp. I can help you if you send me your DB tablet in excel file.
Reply With Quote
  #9  
Old 07-25-2017, 07:38 AM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Edit and sort BOM table

E' possibile avere a video la tabella come ce l'hai tu nell'immagine allegata?
Grazie
Reply With Quote
  #10  
Old 08-17-2017, 05:55 AM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: Edit and sort BOM table

cosa intendi?
Reply With Quote
  #11  
Old 09-05-2017, 10:54 PM
pgagliardi pgagliardi is offline
Registered User
 
Join Date: Sep 2017
Posts: 1
Re: Edit and sort BOM table

Ciao, sarei interessato anche io a mettere in ordine la mia tabella seguendo l'ordine di una colonna. Ho allegato l'esportazione della tabella in excel.
Vorrei riuscire ad ordinare la tabella per la colonna :POSCODICE_BOM.

Puoi darmi indicazione su cosa modificare?

Grazie
Ciao
Attached Thumbnails
Click image for larger version

Name:	tabella_db.PNG
Views:	550
Size:	34.1 KB
ID:	1954  
Attached Files
File Type: zip ESPORTAZIONE_TAB_ANNOTATION.zip (15.6 KB, 556 views)
Reply With Quote
  #12  
Old 10-02-2017, 11:58 AM
Kaji Kaji is offline
Registered User
 
Join Date: Mar 2006
Posts: 19
Re: Edit and sort BOM table

Quote:
Originally Posted by ssusana View Post
thi is my code to sort the BOM by "codice", "fornitore" and "tipo".
the result in the attachment.
Apologies for writing in Italian, but I can't speak English well.

Inoltre chiedo scusa per la domanda forse troppo banale, ma ho sempre utilizzato il PDM con macro etc ed ora a gestire le licenze da solo mi trovo in grossa difficoltà, pertanto chiedevo se questo "code" va inserito nella stringa dei comandi o in un file tipo am_customize ed inoltre come si fa a personalizzare il codice con i campi opportuni?

Infine ho notato nell'immagine che riesci a far comparire gli spazi nella descrizione delle parti, usi la versione 20 oppure anche questo è frutto di una comando o di un codice?

Grazie per la disponibilità.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:20 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.