193 Commits

Author SHA1 Message Date
andrea.villa cba228c626 - Corrette chiamate alle funzioni, si passano solo i pezzi del gruppo
- Piccole migliorie varie
2026-02-06 10:49:06 +01:00
andrea.villa 49d7bccb41 Prima versione (non funzionante) script creazione gruppi 2026-02-03 13:00:44 +01:00
SaraP 057fb91994 DataWindow :
- correzione a SetAreaProfiles.
2026-02-02 17:08:47 +01:00
SaraP d709c374e6 DataWindow :
- aggiunte info per le lavorazioni.
2026-02-02 15:51:36 +01:00
andrea.villa 106c373b52 Prima versione script BatchProcess per automatismo.
NOTE:
- Per ora apre SEMPRE il file C:\\Temp\\Window.nge
- Legge sempre i primi 2 pezzi
- I pezzi vengono riconosciuti in base alla lettura di una nota
La gestione è da rivedere
2026-02-02 09:37:18 +01:00
Annamaria Sassi 73a5ad4507 DataWindow :
- lettura da jwd bottom rail con dimensioni variabili.
2026-01-29 16:34:49 +01:00
Annamaria Sassi f04a6f72c5 DataWindow :
- lettura da jwd pezzi con dimensioni variabili.
2026-01-29 14:56:44 +01:00
SaraP d8d34552e9 DataWindow :
- pezzi con dimensioni variabili ( prima versione).
2026-01-29 12:25:25 +01:00
SaraP b8b10497a7 DataWindow :
- in WinGetAreaProfiles aggiunta gestione degli split.
2026-01-28 15:43:21 +01:00
SaraP 68425bd133 DataWindow :
- piccola modifica a WinGetAreaProfiles per uniformare caso telaio a caso anta.
2026-01-28 11:43:08 +01:00
SaraP d0398e9d5d DataWindow :
- correzioni a WinGetAreaProfiles.
2026-01-26 15:27:01 +01:00
SaraP b27b0e6bf6 DataWindow :
- aggiunta funzione che restituisce i profili dei vari pezzi di un'area telaio o anta.
2026-01-23 12:47:10 +01:00
SaraP c2946b8d9c DataWindow :
- aggiunta funzione che ricava dati dai profili.
2026-01-21 14:49:57 +01:00
SaraP f39063d4d2 DataWindow :
- correzione nel calcolo dei solidi di lavorazione.
2026-01-14 13:13:05 +01:00
Dario Sassi 402400353b Window 3.1a1 :
- aggiunta gestione versione con relativo file
2026-01-14 11:23:07 +01:00
SaraP a85a50d7c1 DataWindow :
- modificato nome file WinConst in CAMAuto per evitare conflitto con Designing
- sistemato caricamento librerie.
2026-01-14 09:28:10 +01:00
Dario Sassi f70604fd6c DataWindow :
- aggiunte immagini e INI per bottoni CAM5.
2026-01-13 19:22:25 +01:00
SaraP b648385b60 DataWindow :
- nell'apertura di un jwd impostato il percorso del file nge allo stesso path cartella del jwd.
2026-01-13 16:36:05 +01:00
SaraP 228d6d4cb3 DataWindow :
- in WinOpenProjectFile riabilitato calcolo ferramenta.
2026-01-13 16:17:19 +01:00
SaraP fee697d330 DataWindow :
- modifiche alla soglia per gestire meglio la preview degli split che terminano sulla soglia.
2026-01-12 14:35:57 +01:00
SaraP 182f5c91db DataWindow :
- correzioni e migliorie nel calcolo delle lavorazioni e dei solidi quando vi è taglio con più pezzi
- correzione estensione archi.
2026-01-12 12:23:44 +01:00
SaraP ce91996f40 DataWindow :
- correzione errore soglia.
2026-01-07 10:13:27 +01:00
SaraP 499ff1f245 DataWindow :
- aggiunta preview soglia.
2025-12-22 12:12:15 +01:00
SaraP c8a7fa0c11 DataWindow :
- gestione di cambio profilo che coinvolge più pezzi ( prima versione).
2025-12-22 11:03:38 +01:00
Annamaria Sassi 17bb7b06ba DataWindow:
- aggiunta lettura threshold da jwd.
2025-12-22 10:36:54 +01:00
SaraP a459c31537 DataWindow :
- migliorie nella preview per casi di profili con ante e telai allineati.
2025-12-17 11:18:51 +01:00
Annamaria Sassi 984ea28304 DataWindow : correzione mancato valore altezza maniglia da opzioni 2025-12-03 17:54:56 +01:00
Annamaria Sassi f20ff953d0 DataWindow :
- correzione tipo dimensione.
2025-12-02 16:36:50 +01:00
Annamaria Sassi f81856f523 DataWindow :
- gestione errore dimensioni telaio.
2025-12-02 15:22:52 +01:00
SaraP a77901fcc3 DataWindow :
- nella creazione degli split aggiunto measure type per ogni valore.
2025-12-02 14:47:42 +01:00
SaraP 36691a7e06 DataWindow :
- correzione errore giunzione a 45°.
2025-12-02 11:59:55 +01:00
SaraP 7564dbdc0b DataWindow :
- correzione errore nella preview con soglia
- migliora nella preview maniglia.
2025-12-02 10:25:56 +01:00
SaraP 46bf9740e5 DataWindow :
- sistemate giunzioni angled per casi di archi e di profili diversi.
2025-12-01 12:19:52 +01:00
Annamaria Sassi 6cee6e52ab DataWindow: in lettura jwd per gli split letto il tipo di misura per le dimensioni. 2025-11-26 16:41:39 +01:00
Annamaria Sassi 65d7bcec33 DataWindow: correzione lettura joint anta singola 2025-11-19 16:21:15 +01:00
Annamaria Sassi 1f3db97f73 DataWindow: spostati joint nelle singole ante 2025-11-19 15:11:48 +01:00
Annamaria Sassi a090d17e07 DataWindow: correzione calcolo dimensioni ante 2025-11-18 18:11:45 +01:00
SaraP 15e3bf7921 DataWindow :
- in lettura jwd per le ante letto il tipo di misura per le dimensioni.
2025-11-17 16:55:07 +01:00
SaraP a79836db69 DataWindow :
- estensione in tangenza per pezzi ad arco nel caso di giunzioni problematiche.
2025-11-17 15:49:47 +01:00
SaraP b1d85c173b DataWindow :
- spostato calcolo del GeoRaw per pezzi ad arco nel calcolo tronchetti
- correzione nel calcolo fill outline per cambio profilo.
2025-11-05 10:02:56 +01:00
SaraP 77fa6641b1 DataWindow :
- aggiunti controlli sulle dimensioni nella creazione di telai ad arco.
2025-11-04 14:39:36 +01:00
Emmanuele Sassi b0259acf2f - cambiato nome arco a tre centri 2025-11-04 12:16:09 +01:00
SaraP 67589d44ef DataWindow :
- arco a 3 centri
- migliorie e correzioni varie per gestire correttamente l'arco a 3 centri ( calcolo solidi, strip, outline del fill).
2025-11-04 11:41:44 +01:00
SaraP 109f43c927 DataWindow :
- correzioni connesione Redis locale.
2025-11-03 11:52:49 +01:00
Emmanuele Sassi 212360c666 - aggiunto funzionamento Redis con connessione sia globale che locale 2025-11-03 10:37:19 +01:00
SaraP f5aae593e1 DataWindow :
- aggiunta lettura opzioni ferramenta da jwd
- sistemate costanti jwd.
2025-10-31 09:02:17 +01:00
SaraP 00c660811d DataWindow :
- correzione calcolo ferramenta per ante multiple.
2025-10-30 16:52:11 +01:00
SaraP 66d41f20a3 DataWindow :
- corretta lettura ferramenta da jwd nel caso di ante multiple.
2025-10-30 15:46:12 +01:00
Emmanuele Sassi d29ecc5a84 - eliminato doppio richiamo hardware
- allungato timeout attesa dati da hardware
- commentata connessione redis per hardware
2025-10-30 11:31:18 +01:00
SaraP bb291d6101 DataWindow :
- AddHardwareByGroupId ora riceve più valori di area number.
2025-10-29 13:04:35 +01:00
SaraP cf8065e226 DataWindow :
- aggiunta funzione per calcolo ferramenta a partire dal numero dell'area e non dal suo id geometrico.
2025-10-29 12:32:39 +01:00
SaraP 6434b264fa DataWindow :
- sistemate forme ante.
2025-10-24 08:24:17 +02:00
SaraP 1d14ff1535 DataWindow :
- sistemato calcolo della ferramenta con preferito nullo '000000'.
2025-10-23 12:18:25 +02:00
SaraP 5d9fad7e3a DataWindow :
- modificata funzione WinGetSashShape per ricevere più aree.
2025-10-23 10:59:44 +02:00
SaraP f04367e529 DataWindow :
- sistemate costanti.
2025-10-23 10:26:45 +02:00
SaraP 407e32d6b0 DataWindow :
- se non definita altezza maniglia, richiesta delle opzioni della ferramenta per ricavarne valore di default
- aggiunta forma dell'anta.
2025-10-21 10:04:35 +02:00
Annamaria Sassi 0173df493d DataWindow :
- connessione Redis per ferramenta.
2025-10-16 14:40:50 +02:00
SaraP 5e4a0b2cb1 DataWindow :
- modifiche per uniformare struttura jwd con struttura del progetto
- gestione numerazione delle aree
- correzioni varie.
2025-10-15 13:01:06 +02:00
Annamaria Sassi 665ad78c87 DataWindow :
- correzione.
2025-10-06 16:52:26 +02:00
SaraP 6c075e9053 DataWindow :
- correzioni varie per casi di split contro 2 pezzi o che comportano cambio di forma
- nuova gestione calcolo fermavetri.
2025-10-06 15:25:27 +02:00
Annamaria Sassi 75be8c4864 Merge branch 'develop' 2025-10-03 11:43:07 +02:00
Annamaria Sassi 5fad7487e0 Modificato split a griglia 2025-09-26 12:50:40 +02:00
Annamaria Sassi bec9c29b2d Modificato split a griglia (split principale orizzontale) 2025-09-26 12:03:38 +02:00
Annamaria Sassi bec8487ef4 Fix split a griglia 2025-09-25 11:56:53 +02:00
SaraP 100db4fb90 DataWindow :
- piccola correzione.
2025-09-25 11:07:09 +02:00
SaraP afe6afc961 DataWindow :
- in preview aggiunte apertura ante e ferramenta
- correzione preview e disegno aperture con bottomrails.
2025-09-25 09:49:14 +02:00
Annamaria Sassi 4c86c76a08 Modificato Split a griglia 2025-09-25 08:55:23 +02:00
Annamaria Sassi 93b8f140c2 Merge branch 'main' into develop 2025-09-23 15:03:38 +02:00
Annamaria Sassi ba95833e1f Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2025-09-22 14:30:24 +02:00
Emmanuele Sassi 638fd85216 - diminuite pause lettura file AGB
- inizio aggiunta lettura opzioni hardware
2025-09-19 12:19:43 +02:00
Emmanuele Sassi 2547bd507b - Aggiunta gestione kit hardware e posizioni di montaggio 2025-09-08 10:41:26 +02:00
Annamaria Sassi 269cf703dd Aggiunto gestione Split Grid 2025-09-04 15:09:58 +02:00
SaraP 199a6e30a5 DataWindow :
- correzione WinGetSectionsTotalLenghts.
2025-08-07 16:01:11 +02:00
SaraP 97dd2074df DataWindow :
- in WinGetSectionsTotalLenghts ora non viene più restituita la lunghezza totale per sezione ma la lista di lunghezze associate alla sezione.
2025-08-07 15:44:40 +02:00
SaraP 275dd114c9 DataWindow :
- sistemati joints in modo da gestirne al massimo 4 e forzare il tipo angled tra pezzi dello stesso tipo.
2025-08-06 11:37:38 +02:00
SaraP a5d68b69f9 DataWindow :
- aggiornate chiavi tabelle per liste con dimensioni vetri e pezzi.
2025-08-04 11:39:32 +02:00
SaraP 12d533288e DataWindow :
- nel caso di vetro non rettangolare restituite le dimensioni del suo box.
2025-07-30 15:08:44 +02:00
SaraP 157107f805 DataWindow :
- aggiunte funzioni per recuperare dal progetto le lunghezze totali per sezione e le dimensioni dei vetri.
2025-07-30 11:21:57 +02:00
Emmanuele Sassi 7239313342 - modificato salvataggio svg 2025-07-29 11:39:55 +02:00
SaraP 71eb7b36e9 DataWindow :
- correzioni preview 2d.
2025-07-23 10:12:48 +02:00
Emmanuele Sassi 08c732c571 - rimosso salvataggio di debug 2025-07-22 17:11:36 +02:00
Emmanuele Sassi 083a2832d6 Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2025-07-22 16:51:57 +02:00
Emmanuele Sassi 9ebc7755c7 - aggiunta funzione per apertura Jwd da stringa
- aggiunta funzione per acquisizione svg
2025-07-22 16:51:49 +02:00
SaraP 9e2c46108d DataWindow :
- aggiunta prima versione preview 2d.
2025-07-22 16:49:04 +02:00
SaraP e75cc0733c DataWindow :
- aggiunta funzione per ricalcolo solidi.
2025-05-16 10:56:23 +02:00
SaraP 3e13958d8a DataWindow :
- eliminata funzioni inutile.
2025-05-13 08:42:52 +02:00
SaraP bca16579ea DataWindow :
- sistemata lettura per file jwd generati dal programma
- eliminata scrittura e salvataggio file ( fatti solo da programma).
2025-05-12 14:42:33 +02:00
SaraP 708f0454ba DataWindow :
- correzioni e migliorie varie sulla ferramenta
- sistemazioni varie per alzante scorrevole.
2025-05-09 10:51:13 +02:00
Emmanuele Sassi 85964d5525 - attivata funziona che imposta path profilo
- cambiata funzione visibilita' ferramenta che riceve un boolean
2025-04-15 17:28:52 +02:00
SaraP 0ea1f00076 DataWindow :
- ulteriori correzioni dowels.
2025-04-09 10:15:33 +02:00
SaraP a9f7404634 DataWindow :
- correzioni nei dowels: inclinazione e gestione di nuove tipologie di lunghezze.
2025-04-08 15:12:00 +02:00
SaraP 398b52cbae DataWindow :
- gestione soglia
- aggiunti zoccoli per ante
- aggiunte funzioni ausiliarie per il programma.
2025-04-03 14:50:05 +02:00
SaraP a2c1032e81 DataWindow :
- riorganizzato file delle costanti.
2025-03-28 09:08:18 +01:00
SaraP 5b7258aaf8 DataWindow :
- correzione zoccoli.
2025-03-28 08:17:14 +01:00
SaraP 7c859b000b DataWindow :
- gestione zoccoli.
2025-03-27 14:33:32 +01:00
SaraP bcbb7e2e5f DataWindow :
- sistemato disegno ferramenta per le varie aperture
- sistemato disegno aperture per ante fisse e scorrevoli.
2025-03-24 11:49:50 +01:00
SaraP 2216c7fdec DataWindow :
- prima correzione ferramenta nel caso di vasistas.
2025-03-21 11:31:32 +01:00
Emmanuele Sassi ea8395a7ca - evitato redraw su salvataggio immagine 2025-03-21 11:19:01 +01:00
SaraP 32b9e4b347 DataWindow :
- correzioni varie.
2025-03-20 11:58:07 +01:00
SaraP 4762dee48c Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2025-03-20 09:45:50 +01:00
SaraP 8efe55e669 DataWindow :
- modificato a sistema il livello del layer ausiliario per solidi
- migliorata la sua gestione.
2025-03-20 09:45:46 +01:00
Dario Sassi 66fa9a9e19 DataWindow :
- modifica per nascondere gruppo Aux (ferramenta) quando si entra in lavorazione.
2025-03-20 09:45:07 +01:00
Dario Sassi f3fbb4ad17 DataWindow :
- corretto posizionamento nei grezzi dei pezzi che non devono essere ruotati.
2025-03-20 01:02:10 +01:00
Dario Sassi e1440b9400 DataWindow :
- modifiche per gestire correttamente più utensili sullo stesso profilo (strutture lua sono sempre per riferimento).
2025-03-20 00:44:20 +01:00
andrea.villa fea1cc0a9e Merge remote-tracking branch 'origin/CAM_Auto' 2025-03-19 18:33:37 +01:00
andrea.villa 62aa67f46d Sistemazioni varie
Commentato momentaneamente ordinamento su cambio utensile
2025-03-19 18:33:26 +01:00
SaraP 4c895d4d5c - aggiunta funzione per esportare immagine. 2025-03-19 17:38:14 +01:00
SaraP 19255f12bc - eliminata info di fase dalle lavorazioni di profiling di testa. 2025-03-19 17:26:33 +01:00
SaraP 5f423dc6cd - aggiunto spessore alle curve geo
- spostati solidi di ferramenta e accessori in layer ausiliario.
2025-03-19 16:49:27 +01:00
SaraP b1fa2e6bcb - sistemata lettura altezza maniglia. 2025-03-19 15:12:25 +01:00
SaraP db3661842a - aggiunto spessore alla curva del GeoRaw per automatismo lavorazioni. 2025-03-19 13:04:57 +01:00
SaraP a2927c3e21 - eliminato file inutile. 2025-03-19 12:04:07 +01:00
SaraP e7a0f8df67 - aggiunti accessori ( guarnizioni e gocciolatoio)
- eliminato file inutile.
2025-03-19 12:03:42 +01:00
Emmanuele Sassi 75ea9604df - riorganizzazione cartella 2025-03-19 11:05:46 +01:00
Emmanuele Sassi 1798f6541f - aggiunte opzioni per ferramenta 2025-03-19 10:27:27 +01:00
SaraP 3b379c4ddb - aggiunto disegno aperture ante
- migliorato disegno cerniere
- correzione minore tronchetti.
2025-03-13 15:30:31 +01:00
SaraP d5d9c05223 - aggiunto disegno ferramenta
- correzioni minori.
2025-03-12 14:44:52 +01:00
SaraP f5e2faef7f - corretta la numerazione delle ante nei nomi dei pezzi
- lettura dei sovramateriali dal profilo.
2025-03-11 17:25:44 +01:00
SaraP ba392fa99f - sistemato passaggio all'automatismo lavorazioni. 2025-03-11 14:45:50 +01:00
SaraP 8d874e6899 - aggiunta funzione in WinProject per calcolare solidi semplificati. 2025-03-11 12:50:09 +01:00
Dario Sassi fb8abd9ef5 Razionalizzazione 2025-03-11 10:45:08 +01:00
SaraP d9e44a3b75 - alzante scorrevole. 2024-12-11 09:55:38 +01:00
SaraP 09fb1e6fdb - calcolo tronchetti
- aggiunto GeoRaw per automatismo lavorazioni
- nel file dei profili aggiunto layer con info per tronchetti.
2024-11-14 14:26:09 +01:00
SaraP bfab9c4990 - correzione joints in WinProject. 2024-10-30 10:07:11 +01:00
SaraP d0bc9e4c89 - modificato WinProject per compatibilità dei joints con il programma. 2024-10-23 12:11:08 +02:00
andrea.villa 8a8c5c6663 Merge remote-tracking branch 'origin/main' into CAM_Auto 2024-10-22 09:36:41 +02:00
andrea.villa 90e5e940c1 - Informazione tipo di profilo
- Prima bozza gestione pezzo con cambio-profilo
2024-10-22 09:36:07 +02:00
SaraP 95cb76ff79 - nei profili aggiunte varianti per cambio profilo. 2024-10-10 14:44:19 +02:00
SaraP 07fc10ddd6 - nascoste lavorazioni. 2024-10-08 09:30:55 +02:00
SaraP 28936ed686 - sistemate lavorazioni per cambio profilo e ferramenta. 2024-10-08 09:22:33 +02:00
andrea.villa b00898728e Merge remote-tracking branch 'origin/main' into CAM_Auto 2024-10-03 12:25:35 +02:00
andrea.villa cbb285ece5 Merge remote-tracking branch 'origin/CAM_Auto' 2024-10-03 12:25:22 +02:00
andrea.villa d32e22993e Info utensili su profilo Mixed 2024-10-03 12:25:08 +02:00
andrea.villa 22c66c9cfd Merge remote-tracking branch 'origin/main' into CAM_Auto 2024-10-03 11:57:18 +02:00
andrea.villa aeeaac3326 - Nuova gestione AddOperation
- Prima versione ordinamento lavorazioni
- In WinLib funzioni base per ordinamento
2024-10-03 11:54:17 +02:00
SaraP c52a6ce2ae - solidi semplificati
- piccole correzioni varie.
2024-10-01 15:17:12 +02:00
SaraP 4fa9e9fce4 - correzioni cambio profilo. 2024-09-20 12:27:58 +02:00
SaraP 9a36037b4c - cambio profilo ( prima versione). 2024-09-11 09:12:32 +02:00
SaraP ece4972c28 - aggiunta lavorazione per strip e info corrispondente sui profili
- aggiunte info CLAMPV per lavorazioni.
2024-08-19 11:27:17 +02:00
SaraP 1a5edcc34b - rimossi dowels esterni ai pezzi di split. 2024-08-09 11:22:51 +02:00
SaraP e4f54c9f19 - migliorati dowels per archi e lati inclinati. 2024-08-07 11:07:37 +02:00
Emmanuele Sassi 9c94096fbd Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-07-26 10:19:22 +02:00
Emmanuele Sassi 2095d0accf - aggiunta funzione per lettura opzioni hardware 2024-07-26 10:19:19 +02:00
andrea.villa 967519492c - Migliorata foratura. Ora calcola ingresso in sicurezza, fase e lato di lavoro
- Migliorato riconoscimento fase di lavoro per profilature
- Prima versione gestione tipo macchina, linea o pantografo
- Corretto offsetX pezzo in base a ingombro profili di testa
- Altre piccole correzioni
2024-07-15 08:47:34 +02:00
andrea.villa f42a64eea8 Merge remote-tracking branch 'origin/main' into CAM_Auto 2024-07-08 15:33:28 +02:00
SaraP 5dd44069bc - correzione telaio triangolare
- gestione delle giunzioni come vettore
- modificato il calcolo delle sottaree generate da uno split
- aggiunta info lato di riferimento per lavorazione dowels
- correzioni varie per telai non rettangolari.
2024-07-05 12:15:11 +02:00
andrea.villa 4546497a1e Aggiunta lavorazione (primordiale) di foratura 2024-06-28 09:30:31 +02:00
andrea.villa 70c0991470 Merge remote-tracking branch 'origin/HEAD' into CAM_Auto 2024-06-27 16:47:21 +02:00
Emmanuele Sassi 695422f484 - gestita mancanza hardware
- gestito handle in ferramenta
2024-06-26 15:45:54 +02:00
Emmanuele Sassi 44a93e8d8a Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-06-25 17:46:04 +02:00
SaraP a72a2d9069 - aggiunte funzioni per creare telai con forme non rettangolari
- modifiche varie per gestire correttamente le nuove forme (prima versione).
2024-06-25 16:48:52 +02:00
Emmanuele Sassi f20a10fde6 - modificato AddHardware per calcolarlo su singoli gruppi di sash
- aggiunte funzioni per calcolare hardware da programma
2024-06-24 10:12:09 +02:00
andrea.villa f6beff942c Merge branch 'CAM_Auto' 2024-06-24 08:49:09 +02:00
andrea.villa 7fd27d867d Merge remote-tracking branch 'origin/main' into CAM_Auto 2024-06-21 17:15:51 +02:00
andrea.villa 28e38b0441 - Lavorazione profili nella fase opportuna
- Migliorie varie
2024-06-21 17:15:37 +02:00
SaraP 93e1a56e29 - corretta la direzione dei fori. 2024-06-21 15:06:41 +02:00
andrea.villa 66869aa0d8 - Ridefinito flusso automatismo
- Aggiunta gestion AuxInfo per gestire ordine lavorazioni
- Piccole migliorie varie
2024-06-20 16:52:11 +02:00
SaraP 4a9bca5843 - modifiche per automatismo lavorazioni
- creazione di un unico solido anche per strip
- invertite curve CtrIn1 e OfstCtrIn1 nei profili di split.
2024-06-20 08:57:46 +02:00
andrea.villa fb87f53b7c Merge remote-tracking branch 'origin/main' into CAM_Auto 2024-06-20 08:38:22 +02:00
andrea.villa cc3ac6e186 - Prima versione lavorazione Profiling
- aggiunta funzione GetAffectedFaces per calcolo facce di riferimento
- Lettura DB Utensili (da sistemare)
- Gestione multipezzo in raccolta e lavorazione feature
- Piccole correzioni varie
2024-06-20 08:36:46 +02:00
Emmanuele Sassi c988d0004a - nascosti dowel e profili 2024-06-19 07:16:56 +02:00
Emmanuele Sassi cc8bc8fb8d Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-06-18 15:49:54 +02:00
Emmanuele Sassi c807df355c - modifica creazione aree di selezione
- aggiunte info per gestione split multipli
- resettate variabili globali su chiamate da programma
2024-06-18 15:48:59 +02:00
SaraP a47204dc6f - aggiunti profili French_In e French_out
- gestione di finestre con più ante battente/ricevente
- nelle creazione della finestra vengono salvati tutti i children di una curva.
2024-06-18 11:38:11 +02:00
andrea.villa 1c00c1224b - Crazione strategie di lavorazione (per ora è una per tipo)
- Rimosso da WinExec gestione strategie derivata da Beam
- Pulita Collect da parametri provenienti da BTL
- ProcessFeature semplitifacta. Non contempla rotazioni/ribaltamenti del pezzo
- Aggiunta libreria delle lavorazioni
- Aggiunta libreria identità di una lavorazione
- Aggiunta libreria recupero informazioni feature
- AlignRawsToTable spostata in ProcessWin (prima era nella macchina)
2024-06-17 17:09:43 +02:00
SaraP 2209ad2415 - reso il calcolo dei dowels indipendente dal calcolo del solido. 2024-06-17 09:50:41 +02:00
andrea.villa 51ac46ca73 - Corretto posizionamento pezzi in tavola 2024-06-14 15:55:53 +02:00
andrea.villa 7f9e7621f5 - migliorato flusso automatismo
- aggiunta chiamata alla WinLib
2024-06-14 11:32:16 +02:00
andrea.villa 7d571bff39 - Creazione WinExec (derivazione da progetto Beam)
- Funzione allineamento pezzo
- Funzione aggiunta sovramateriale pezzo
- Altre modifiche minori
2024-06-13 12:32:23 +02:00
andrea.villa 9d493812d9 - Creazione directoy per CAM Auto
- Creata Process, selezione pezzi manuale (NON FUNZIONANTE)
2024-06-13 10:27:19 +02:00
SaraP d2cb941412 - aggiornato file dei profili con info automatismo di "Profilo78 - Offset - Copy (44)"
- sistemato profilo Fixed_Top e info dowels corrispondenti.
2024-06-10 11:24:11 +02:00
SaraP e48dbe7268 - aggiunte lavorazioni
- gestione della ferramenta anche senza il calcolo del solido.
2024-06-10 09:13:18 +02:00
andrea.villa 60a258353c Aggiunto "Profilo78 - Offset - Copy (44)" con info profili per automatismo 2024-06-07 11:41:43 +02:00
SaraP 9a6bde56da EgwWindowLua :
- reimpostata visibilità profili.
2024-06-06 12:22:03 +02:00
SaraP e6f7ffa94f EgwWindowLua :
- nel profilo Fixed_Top ripristinato orientamento controprofili in.
2024-06-06 12:15:19 +02:00
Emmanuele Sassi 90ffd17785 Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-06-06 08:48:11 +02:00
Emmanuele Sassi 7e763c4f86 - correzioni per disegno serramento parziale
- profilo aggiornato con semiprofilo In
2024-06-06 08:47:33 +02:00
SaraP 5912724a06 EgwWindowLua :
- creazione del solido come unica superficie.
2024-06-06 08:43:28 +02:00
Emmanuele Sassi ef71f77f99 Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-05-30 09:15:35 +02:00
Emmanuele Sassi dbd9e4ac01 - aggiunto passaggio dimensioni a calcolo ferramenta
- creazione origini per ferramenta
- gestione lavorazione asola e vite
2024-05-30 09:15:32 +02:00
SaraP 536c969471 EgwWindowLua :
- correzioni e migliorie varie.
2024-05-29 08:59:49 +02:00
SaraP c831af6899 EgwWindowLua :
- integrato il calcolo degli split dowels nel calcolo del solido
- modifica alla struttura della ricorsione nel calcolo dei pezzi dal telaio.
2024-05-27 14:37:25 +02:00
SaraP 6c684e3068 EgwWindowLua :
- correzione minore ferramenta.
2024-05-22 17:35:09 +02:00
SaraP 05b8da0317 EgwWindowLua :
- uniformata info che collega le curve di outline a quelle del base outline.
2024-05-22 11:45:29 +02:00
Emmanuele Sassi 009f99f579 Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-05-22 09:18:26 +02:00
Emmanuele Sassi 48c26500a4 - inizio implementazione gestione hardware 2024-05-22 09:18:22 +02:00
SaraP 92ef41dd6f EgwWindowLua :
- prima sistemazione dei dowels per gestire meglio il caso di archi
- migliorie varie.
2024-05-22 08:47:18 +02:00
Emmanuele Sassi 701c8d77e5 - correzzione creazione area di selezione per merge 2024-05-21 10:25:50 +02:00
Emmanuele Sassi 1d6c02c9ae Merge branch 'main' of https://gitlab.steamware.net/egalware-cadcam/lua/egwwindowlua 2024-05-21 10:15:21 +02:00
Emmanuele Sassi d7390bfa44 - modifiche per interfaccia progettazione finestre 2024-05-21 10:02:22 +02:00
SaraP 17f97c21f2 EgwWindowLua :
- modifiche stilistiche varie ( rese locali alcune funzioni, unite parti ripetute, eliminate variabili inultizzate,...).
2024-05-13 16:22:28 +02:00
Emmanuele Sassi cb9bb33fa5 - aggiunto WinProject per richiamare funzioni lua dal programma 2024-01-25 10:36:25 +01:00
Emmanuele Sassi 4c976f87cc - gestita creazione solo telaio
- gestiti nuovi casi di giunzione con spine degli split
- nascosto gruppo delle aree
- gestita funzione di creazione multisplit con aggiunta definizione posizione in percentuale
- elimino profile su apertura file da BatchTest
2024-01-25 10:35:11 +01:00
113 changed files with 13345 additions and 9490 deletions
+37 -1
View File
@@ -102,7 +102,43 @@
"EgtOutLog",
"EgtOutText",
"EgtPause",
"EgtRelocate"
"EgtRelocate",
"WDG",
"EgtSplitString",
"EgtFrame",
"EgtReplaceString",
"EgtCircle",
"EgtArc2PV",
"EgtTdbSetCurrTool",
"EgtSurfTmSubtract",
"EgtSurfTmIntersect",
"GDB_IN",
"GEO",
"dist",
"EgtSetMachiningParam",
"EgtCreateMachining",
"EgtSetMachiningGeometry",
"EgtGetMachiningParam",
"EgtGetLastMachMgrError",
"EgtSetOperationMode",
"EgtApplyMachining",
"EgtSetCurrPhase",
"EgtApplyAllMachinings",
"EgtGetDebugLevel",
"EgtTdbGetCurrToolParam",
"EgtTdbGetCurrToolThDiam",
"EgtTdbGetCurrToolMaxDepth",
"EgtTdbGetCurrToolThLength",
"EgtFindToolInCurrSetup",
"EgtTdbGetFirstTool",
"EgtTdbGetNextTool",
"EgtMdbSave",
"EgtMoveRawPart",
"EgtCurveThickness",
"EgtSetCurrMachining",
"EgtCAvSetStdTool",
"EgtCAvToolPosStm",
"EgtCAvToolPosBox"
],
"Lua.diagnostics.disable": [
"empty-block"
+409
View File
@@ -0,0 +1,409 @@
-- BatchProcessNew.lua by Egalware s.r.l. 2025/04/24
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- TODO DA CANCELLARE!!!! quando verrà passato automaticamente da programma
local WIN = {}
WIN.BASEDIR = 'C:\\EgtData\\Window\\CAMAuto'
WIN.FILE = 'C:\\Temp\\Window.nge'
-- Imposto direttorio libreria specializzata per serramenti
EgtAddToPackagePath( WIN.BASEDIR .. '\\LuaLibs\\?.lua')
-- Imposto direttorio strategie. N.B. Le strategie dovranno essere caricate con il nome del direttorio padre
EgtAddToPackagePath( WIN.BASEDIR .. '\\Strategies\\?.lua')
local sTxtLogFile = EgtChangePathExtension( WIN.FILE, '.txt')
EgtOpenFile( WIN.FILE)
-- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi
local sMachDir = EgtGetCurrMachineDir()
if not sMachDir then
EgtOutBox( 'Errore nel caricamento della macchina corrente', 'Lavora Serramenti', 'ERROR')
return
end
if not EgtExistsFile( sMachDir .. '\\Window\\WinData.lua') then
EgtOutBox( 'La macchina corrente non è configurata per lavorare serramenti', 'Lavora Serramenti', 'ERROR')
return
end
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
EgtRemoveBaseMachineDirFromPackagePath()
EgtAddToPackagePath( sMachDir .. '\\Window\\?.lua')
-- Segnalazione avvio
EgtOutLog( '*** Window Process Start ***', 1)
-- Carico le librerie
_G.package.loaded.WinData = nil
_G.package.loaded.WinExec = nil
_G.package.loaded.WinLib = nil
_G.package.loaded.FeatureData = nil
_G.package.loaded.MachiningLib = nil
local WinExec = require( 'WinExec')
-- Carico i dati globali
local WinData = require( 'WinData')
-- Variabili globali
PARTS = {} -- tabella contenente tutte le informazioni di ogni pezzo
-- Colore del grezzo
local ColA = Color3d( 255, 165, 0, 30)
-------------------------------------------------------------------------------------------------------------
local function GetDataConfig()
-- recupero utensili dal magazzino
WinExec.GetToolsFromDB()
-- TODO da gestire eventuali errori bloccanti
return true
end
-------------------------------------------------------------------------------------------------------------
local function WriteErrToLogFile( nErr, sMsg, nRot, idCut, idTask)
local hFile = io.open( sTxtLogFile, 'a')
hFile:write( 'ERR=' .. tostring( nErr) .. '\n')
hFile:write( sMsg .. '\n')
hFile:write( 'ROT=' .. tostring( nRot or 0) .. '\n')
hFile:write( 'CUTID=' .. tostring( idCut or 0) .. '\n')
hFile:write( 'TASKID=' .. tostring( idTask or 0) .. '\n')
hFile:close()
end
-------------------------------------------------------------------------------------------------------------
-- *** Recupero i pezzi da processare ***
-------------------------------------------------------------------------------------------------------------
local function MyProcessInputData()
-- Recupero le travi selezionate
local nId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nId do
-- Per capire se è un pezzo controllo una nota, servirebbe info dedicata, oppure essere sicuri che vengano passati solo pezzi
if EgtGetInfo( nId, 'OFFY_1', 'd') then
table.insert( PARTS, { id = nId, sName = ( EgtGetName( nId) or ( 'Id=' .. tonumber( nId)))})
-- TODO RIMUOVERE! Bisogna sempre prendere tuttti i pezzi all'interno del file. Devono arrivare solo i pezzi da mettere nella macchinata
if #PARTS == 2 then
break
end
end
nId = EgtGetNext( nId)
end
if #PARTS == 0 then
EgtOutBox( 'Non ci sono pezzi', 'Lavora Pezzi', 'ERROR')
return false
else
-- recupero tutte le dimensioni necessarie
local sOut = ''
for i = 1, #PARTS do
PARTS[i].b3Raw = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw') or GDB_ID.NULL, GDB_BB.STANDARD)
PARTS[i].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
local idFrame = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw'), 'AuxFrame')
PARTS[i].frame = EgtFR( idFrame)
sOut = sOut .. PARTS[i].sName .. ', '
end
sOut = sOut:sub( 1, -3)
EgtOutLog( 'Pezzi selezionati : ' .. sOut, 1)
end
EgtDeselectAll()
return true
end
-------------------------------------------------------------------------------------------------------------
local function GetDispOffsetFromNotes( nPieceIndex)
local bAllOffsetsAreOk = false
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_1', 'd')
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_1', 'd')
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_2', 'd')
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_2', 'd')
-- controllo se tutti gli offset siano settati
if PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ and
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ then
bAllOffsetsAreOk = true
end
return bAllOffsetsAreOk
end
-------------------------------------------------------------------------------------------------------------
local function GetDispOffsetFromInput( nPieceIndex)
-- assegno alle stringhe i valori letti, in modo che vengano proposti quelli nel dialogo
local sOffYPh1 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY, tostring( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY), tostring( PARTS[nPieceIndex].dPartWidth / 2))
local sOffZPh1 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ, tostring( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ), '0')
local sOffYPh2 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY, tostring( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY), tostring( PARTS[nPieceIndex].dPartWidth / 2))
local sOffZPh2 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ, tostring( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ), '0')
local vInp = EgtDialogBox( 'Dati di disposizione pezzo: ' .. PARTS[nPieceIndex].sName,
{'Sporgenza laterale FASE1', sOffYPh1}, {'Posizione Z FASE1', sOffZPh1},
{'Sporgenza laterale FASE2', sOffYPh2}, {'Posizione Z FASE2', sOffZPh2})
if not vInp or #vInp == 0 then
return false
end
-- salvo input nei valori che utilizzerò dopo
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = tonumber( vInp[1])
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = tonumber( vInp[2])
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = tonumber( vInp[3])
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = tonumber( vInp[4])
return true
end
---------------------------------------------------------------------
-- Crea il grezzo che verrà messo in macchina
---------------------------------------------------------------------
local function AddOverMaterialToRaw( PARTS)
for i = 1, #PARTS do
-- prima di aggiungere sovramateriale al grezzo, calcolo dimensioni del finito
local b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
PARTS[i].b3Part = b3Part
PARTS[i].dPartLength = PARTS[i].b3Part:getDimX()
PARTS[i].dPartWidth = PARTS[i].b3Part:getDimY()
PARTS[i].dPartHeight = PARTS[i].b3Part:getDimZ()
-- recupero sovramateriale
PARTS[i].RawOffset = {}
-- recupero info sovramateriale
PARTS[i].RawOffset.dOverMatIn = EgtGetInfo( PARTS[i].id, 'OVERMAT_IN', 'd') or 5
PARTS[i].RawOffset.dOverMatOut = EgtGetInfo( PARTS[i].id, 'OVERMAT_OUT', 'd') or 5
PARTS[i].RawOffset.dOverMatLeft = EgtGetInfo( PARTS[i].id, 'OVERMAT_LEFT', 'd') or 5
PARTS[i].RawOffset.dOverMatRight = EgtGetInfo( PARTS[i].id, 'OVERMAT_RIGHT', 'd') or 5
PARTS[i].dRawLength = PARTS[i].RawOffset.dOverMatLeft + PARTS[i].dPartLength + PARTS[i].RawOffset.dOverMatRight
PARTS[i].dRawWidth = PARTS[i].RawOffset.dOverMatOut + PARTS[i].dPartWidth + PARTS[i].RawOffset.dOverMatIn
PARTS[i].dRawHeight = PARTS[i].dPartHeight
EgtModifyRawPartSize( PARTS[i].idRaw, PARTS[i].dRawLength, PARTS[i].dRawWidth, PARTS[i].dPartHeight)
local vtMove = Vector3d( PARTS[i].RawOffset.dOverMatLeft, PARTS[i].RawOffset.dOverMatOut, 0)
EgtMovePartInRawPart( PARTS[i].id, vtMove)
-- TODO da controllare, se ruotato di 180° bisognerebbe prendere dOverMatIn. Lo stesso per la X
PARTS[i].OffsetPartToRaw = {}
PARTS[i].OffsetPartToRaw.X = PARTS[i].RawOffset.dOverMatLeft
PARTS[i].OffsetPartToRaw.Y = PARTS[i].RawOffset.dOverMatOut
end
end
---------------------------------------------------------------------
-- Crea il grezzo che verrà messo in macchina
---------------------------------------------------------------------
local function CreateRaws( PARTS)
for i = 1, #PARTS do
-- si crea un grezzo "finto" (un cubo da 100mm) nell'origine del pezzo, verrà poi dimensionato uan volta adeguato con i vari sovramateriali
PARTS[i].idRaw = EgtAddRawPart( PARTS[i].frame:getOrigin(), 100, 100, 100, ColA)
EgtAddPartToRawPart( PARTS[i].id, ORIG(), PARTS[i].idRaw)
end
end
---------------------------------------------------------------------
-- Allinea i pezzi in base a come devono essere disposti sulla tavola
---------------------------------------------------------------------
-- TODO in questa fase bisogna già sapere qual è la prima fase e posizionare il pezzo di conseguenza
-- TODO (bassa priorità) adesso allinea sempre in X, ma bisognerebbe farlo in base ad un parametro in WINDATA che dice come si dispongono in macchina
local function AlignRawsToTable( PARTS)
for i = 1, #PARTS do
-- allineo il pezzo all'interno del grezzo
local dRotX, dRotY, dRotZ = GetFixedAxesRotABCFromFrame( PARTS[i].frame)
-- se devo ruotare
if abs( dRotZ) > GEO.EPS_ANG_SMALL then
EgtRotatePartInRawPart( PARTS[i].id, Z_AX(), -dRotZ)
end
-- sposto punto in basso a sinistra del pezzo sul punto in basso a sinistra del grezzo
local b3Part = EgtGetBBoxGlob( PARTS[i].id, GDB_BB.ONLY_VISIBLE)
local dPartPosX = b3Part:getMin():getX()
local dPartPosY = b3Part:getMin():getY()
local dPartPosZ = b3Part:getMin():getZ()
local b3Raw = EgtGetRawPartBBox( PARTS[i].idRaw)
local dRawPosX = b3Raw:getMin():getX()
local dRawPosY = b3Raw:getMin():getY()
local dRawPosZ = b3Raw:getMin():getZ()
local vtMove = Vector3d( dRawPosX - dPartPosX, dRawPosY - dPartPosY, dRawPosZ - dPartPosZ)
EgtMovePartInRawPart( PARTS[i].id, vtMove)
end
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Funzione per trovare nome MachGroup ***
-------------------------------------------------------------------------------------------------------------
local function NewMachGroupName()
local nMachGroupId = EgtGetFirstMachGroup()
if not nMachGroupId then return '1' end
local nMaxMachGroup = 0
while nMachGroupId do
local sMachGroupName = EgtGetMachGroupName( nMachGroupId)
local nMachGroupName = tonumber( sMachGroupName)
if nMachGroupName > nMaxMachGroup then
nMaxMachGroup = nMachGroupName
end
nMachGroupId = EgtGetNextMachGroup( nMachGroupId)
end
return tostring( nMaxMachGroup + 1)
end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento delle travi nel grezzo ***
-------------------------------------------------------------------------------------------------------------
local function MyProcessPieces()
-- creo macchinata
local MachGroupName = NewMachGroupName()
local nMachGroup = EgtAddMachGroup( MachGroupName)
-- si crea il grezzo
CreateRaws( PARTS)
-- allineo i pezzi come orientamento richiesto dalla macchina
AlignRawsToTable( PARTS)
-- aggiungo sovramateriale ai grezzi
AddOverMaterialToRaw( PARTS)
-- recupero offset per posizionamento
for i = 1, #PARTS do
PARTS[i].DispOffsets = {}
PARTS[i].DispOffsets.Phase1 = {}
PARTS[i].DispOffsets.Phase2 = {}
local bInsertedAllOffs = GetDispOffsetFromNotes( i)
-- se non sono settati nelle note, li chiedo
if not bInsertedAllOffs then
bInsertedAllOffs = GetDispOffsetFromInput( i)
end
-- se non sono stati inseriti o c'è stato un errore esco subito
if not bInsertedAllOffs then
return false
end
end
-- si dispongono i pezzi sulla tavola
local bDispOk, sErr = WinData.ExecDisposition( PARTS)
if not bDispOk then
if not sErr then
sErr = 'Errore non gestito in WinData.ExecDisposition'
end
EgtOutBox( sErr, 'ProcessWin', 'ERROR', 'OK')
return false
end
-- Impostazione dell'attrezzaggio di default
local bOk = EgtImportSetup()
if not bOk then
EgtImportSetup( 'Default')
end
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento delle lavorazioni ***
-------------------------------------------------------------------------------------------------------------
local function MyProcessFeatures()
local bOk = WinExec.ProcessFeatures( PARTS)
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Esecuzione ***
-------------------------------------------------------------------------------------------------------------
-- script principale
local sFlag = ''
if WIN.FLAG == 0 then
sFlag = 'CHECK+GENERATE'
else
sFlag = 'FLAG='..tostring( WIN.FLAG)
end
local sLog = 'BatchProcess : ' .. WIN.FILE .. ', ' .. ( WIN.MACHINE or EgtGetCurrMachineName()) .. ', ' .. sFlag
EgtOutLog( sLog)
-- Se da elaborare
EgtOutLog( ' +++ Processing Parts >>>')
-- nascondo geometrie varie
local vAuxId = { EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Profile'), EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Area*'), EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Aux')}
EgtSetStatus( vAuxId, GDB_ST.OFF)
if not MyProcessInputData() then return end
if not MyProcessPieces() then return end
if not GetDataConfig() then return end
-- Abilito Vmill
EgtSetInfo( EgtGetCurrMachGroup(), 'Vm', '1')
if not MyProcessFeatures() then return end
-- Imposto Nome file CN
local _, sName, _ = EgtSplitPath( WIN.FILE)
EgtSetInfo( EgtGetCurrMachGroup(), 'NcName', sName .. '.cnc')
-- Salvo il progetto
EgtSaveFile( WIN.FILE)
-- *** Eseguo simulazione con verifica collisione in cieco ***
local bSimOk, nErr, sErr = EgtSimulate()
if not bSimOk then
if nErr == MCH_SHE.INIT then
WIN.ERR = 19
WIN.MSG = 'Error starting simulation'
elseif nErr == MCH_SHE.COLLISION then
WIN.ERR = 22
WIN.MSG = 'Head-part collision'
elseif nErr == MCH_SHE.OUTSTROKE then
WIN.ERR = 23
WIN.MSG = 'Axis outstroke ' .. sErr
elseif nErr == MCH_SHE.SPECIAL then
WIN.ERR = 24
WIN.MSG = 'Special error ' .. sErr
else
WIN.ERR = 25
WIN.MSG = 'General failure (contact supplier)'
end
WIN.ROT = 0
WIN.CUTID = 0
WIN.TASKID = 0
local vItem = EgtSplitString( sErr, ';') or {}
for i = 1, #vItem do
vItem[i] = EgtTrim( vItem[i] or '')
end
WriteErrToLogFile( WIN.ERR, WIN.MSG, WIN.ROT, WIN.CUTID, WIN.TASKID)
-- TODO gestire collisione su feature specifica!!!!!!!!!!!!!!!!!!!!!!!!!!!!
BeamExec.AddApplyResultToGlobalList( WIN.ERR, WIN.CUTID, WIN.MSG)
WIN.RESULT = WinLib.TableCopyDeep( RESULT)
WriteResultToJson( RESULT)
return
end
-- *** Genero programma CN *** ( se richiesto)
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
if bIsGenerationEnabled then
EgtOutLog( ' +++ Generating NC part program >>>')
-- TODO gestire generazione
end
-- *** Eseguo stima tempi ***
EgtOutLog( ' +++ Estimating T&L >>>')
if not EgtEstimate( '', 'EgtCAM5 - ' .. WIN.FILE) then
-- TODO gestire errori in stima
end
EgtOutLog( ' +++ BatchProcess completed')
+374
View File
@@ -0,0 +1,374 @@
-- Process.lua by Egalware s.r.l. 2024/06/13
-- Gestione calcolo disposizione e lavorazioni per serramenti
-- Si opera sulla macchina corrente
-- 2024/06/13 PRIMA VERSIONE
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi
local sMachDir = EgtGetCurrMachineDir()
if not sMachDir then
EgtOutBox( 'Errore nel caricamento della macchina corrente', 'Lavora Serramenti', 'ERROR')
return
end
if not EgtExistsFile( sMachDir .. '\\Window\\WinData.lua') then
EgtOutBox( 'La macchina corrente non è configurata per lavorare serramenti', 'Lavora Serramenti', 'ERROR')
return
end
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
EgtRemoveBaseMachineDirFromPackagePath()
EgtAddToPackagePath( sMachDir .. '\\Window\\?.lua')
-- Segnalazione avvio
EgtOutLog( '*** Window Process Start ***', 1)
-- Carico le librerie
-- Carico i dati globali
local WinData = require( 'WinData')
-- Variabili globali
PARTS = {}
GROUPS = {}
-- Colore del grezzo
local ColA = Color3d( 255, 165, 0, 30)
-- TODO DA RIMUOVERE, il parametro deve essere passato
local WIN = {}
WIN.OPT_TYPE = 'PIECE'
-------------------------------------------------------------------------------------------------------------
-- *** Recupero offset applicato al profilo ***
-------------------------------------------------------------------------------------------------------------
local function GetDispOffsetFromNotes( nPieceIndex)
local bAllOffsetsAreOk = false
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_1', 'd')
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_1', 'd')
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_2', 'd')
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_2', 'd')
-- controllo se tutti gli offset siano settati
if PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ and
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ then
bAllOffsetsAreOk = true
end
return bAllOffsetsAreOk
end
-------------------------------------------------------------------------------------------------------------
-- *** Recupero i pezzi da processare ***
-------------------------------------------------------------------------------------------------------------
local function GetInfoPieces()
-- Recupero le travi selezionate
local nId = EgtGetFirstPart()
while nId do
-- TODO caricare il file di costanti
-- si processano solo BOTTOMRAIL (WIN_PART_TYPES.BOTTOMRAIL = 2) o STANDARD (WIN_PART_TYPES.STD = 3)
if EgtGetInfo( nId, 'PART_TYPE', 'd') == 2 or EgtGetInfo( nId, 'PART_TYPE', 'd') == 3 then
table.insert( PARTS, { id = nId, sName = ( EgtGetName( nId) or ( 'Id=' .. tonumber( nId)))})
end
nId = EgtGetNextPart( nId)
end
if #PARTS == 0 then
EgtOutBox( 'Non ci sono pezzi', 'Lavora Pezzi', 'ERROR')
return false
else
-- recupero tutte le dimensioni necessarie
local sOut = ''
for i = 1, #PARTS do
PARTS[i].b3Raw = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw') or GDB_ID.NULL, GDB_BB.STANDARD)
local idFrame = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw'), 'AuxFrame')
PARTS[i].frame = EgtFR( idFrame)
-- recupero offset per posizionamento
PARTS[i].DispOffsets = {}
PARTS[i].DispOffsets.Phase1 = {}
PARTS[i].DispOffsets.Phase2 = {}
local bInsertedAllOffs = GetDispOffsetFromNotes( i)
-- recupero info profili
PARTS[i].SemiProfiles = {}
table.insert( PARTS[i].SemiProfiles, EgtGetInfo( PARTS[i].id, 'PROFILE_IN', 's') or '')
table.insert( PARTS[i].SemiProfiles, EgtGetInfo( PARTS[i].id, 'PROFILE_OUT', 's') or '')
table.insert( PARTS[i].SemiProfiles, EgtGetInfo( PARTS[i].id, 'PROFILE_LEFT', 's') or '')
table.insert( PARTS[i].SemiProfiles, EgtGetInfo( PARTS[i].id, 'PROFILE_RIGHT', 's') or '')
-- TODO info deve essere passata da programma
-- recupero info finestra
PARTS[i].sWindow = EgtGetInfo( PARTS[i].id, 'WIN_ID', 's') or ''
-- TODO è lo stesso del PART_TYPE o serve altro??? da verificare!
-- tipo di pezzo
PARTS[i].sPieceType = EgtGetInfo( PARTS[i].id, 'PART_TYPE', 'd') or ''
-- definisco il pezzo per famiglia ( TODO da recuperare dal nome del pezzo, o da una nota)
-- se non sono stati inseriti o c'è stato un errore esco subito
if not bInsertedAllOffs then
return false
end
sOut = sOut .. PARTS[i].sName .. ', '
end
sOut = sOut:sub( 1, -3)
EgtOutLog( 'Pezzi : ' .. sOut, 1)
end
EgtDeselectAll()
return true
end
---------------------------------------------------------------------
-- Aggiunge al grezzo i sovramateriali pre-impostati
---------------------------------------------------------------------
local function AddOverMaterialToRaw( PiecesInMachGroup)
for i = 1, #PiecesInMachGroup do
-- prima di aggiungere sovramateriale al grezzo, calcolo dimensioni del finito
local b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PiecesInMachGroup[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
PiecesInMachGroup[i].b3Part = b3Part
PiecesInMachGroup[i].dPartLength = PiecesInMachGroup[i].b3Part:getDimX()
PiecesInMachGroup[i].dPartWidth = PiecesInMachGroup[i].b3Part:getDimY()
PiecesInMachGroup[i].dPartHeight = PiecesInMachGroup[i].b3Part:getDimZ()
-- recupero sovramateriale
PiecesInMachGroup[i].RawOffset = {}
-- recupero info sovramateriale
PiecesInMachGroup[i].RawOffset.dOverMatIn = EgtGetInfo( PiecesInMachGroup[i].id, 'OVERMAT_IN', 'd') or 5
PiecesInMachGroup[i].RawOffset.dOverMatOut = EgtGetInfo( PiecesInMachGroup[i].id, 'OVERMAT_OUT', 'd') or 5
PiecesInMachGroup[i].RawOffset.dOverMatLeft = EgtGetInfo( PiecesInMachGroup[i].id, 'OVERMAT_LEFT', 'd') or 5
PiecesInMachGroup[i].RawOffset.dOverMatRight = EgtGetInfo( PiecesInMachGroup[i].id, 'OVERMAT_RIGHT', 'd') or 5
PiecesInMachGroup[i].dRawLength = PiecesInMachGroup[i].RawOffset.dOverMatLeft + PiecesInMachGroup[i].dPartLength + PiecesInMachGroup[i].RawOffset.dOverMatRight
PiecesInMachGroup[i].dRawWidth = PiecesInMachGroup[i].RawOffset.dOverMatOut + PiecesInMachGroup[i].dPartWidth + PiecesInMachGroup[i].RawOffset.dOverMatIn
PiecesInMachGroup[i].dRawHeight = PiecesInMachGroup[i].dPartHeight
EgtModifyRawPartSize( PiecesInMachGroup[i].idRaw, PiecesInMachGroup[i].dRawLength, PiecesInMachGroup[i].dRawWidth, PiecesInMachGroup[i].dPartHeight)
local vtMove = Vector3d( PiecesInMachGroup[i].RawOffset.dOverMatLeft, PiecesInMachGroup[i].RawOffset.dOverMatOut, 0)
EgtMovePartInRawPart( PiecesInMachGroup[i].id, vtMove)
-- TODO da controllare, se ruotato di 180° bisognerebbe prendere dOverMatIn. Lo stesso per la X
PiecesInMachGroup[i].OffsetPartToRaw = {}
PiecesInMachGroup[i].OffsetPartToRaw.X = PiecesInMachGroup[i].RawOffset.dOverMatLeft
PiecesInMachGroup[i].OffsetPartToRaw.Y = PiecesInMachGroup[i].RawOffset.dOverMatOut
end
end
---------------------------------------------------------------------
-- Crea il grezzo che verrà messo in macchina
---------------------------------------------------------------------
local function CreateRaws( PiecesInMachGroup)
for i = 1, #PiecesInMachGroup do
-- si crea un grezzo "finto" (un cubo da 100mm) nell'origine del pezzo, verrà poi dimensionato uan volta adeguato con i vari sovramateriali
PiecesInMachGroup[i].idRaw = EgtAddRawPart( PiecesInMachGroup[i].frame:getOrigin(), 100, 100, 100, ColA)
EgtAddPartToRawPart( PiecesInMachGroup[i].id, ORIG(), PiecesInMachGroup[i].idRaw)
end
end
---------------------------------------------------------------------
-- Allinea i pezzi in base a come devono essere disposti sulla tavola
---------------------------------------------------------------------
-- TODO in questa fase bisogna già sapere qual è la prima fase e posizionare il pezzo di conseguenza
-- TODO (bassa priorità) adesso allinea sempre in X, ma bisognerebbe farlo in base ad un parametro in WINDATA che dice come si dispongono in macchina
local function AlignRawsToTable( PiecesInMachGroup)
for i = 1, #PiecesInMachGroup do
-- allineo il pezzo all'interno del grezzo
local dRotX, dRotY, dRotZ = GetFixedAxesRotABCFromFrame( PiecesInMachGroup[i].frame)
-- se devo ruotare
if abs( dRotZ) > GEO.EPS_ANG_SMALL then
EgtRotatePartInRawPart( PiecesInMachGroup[i].id, Z_AX(), -dRotZ)
end
-- sposto punto in basso a sinistra del pezzo sul punto in basso a sinistra del grezzo
local b3Part = EgtGetBBoxGlob( PiecesInMachGroup[i].id, GDB_BB.ONLY_VISIBLE)
local dPartPosX = b3Part:getMin():getX()
local dPartPosY = b3Part:getMin():getY()
local dPartPosZ = b3Part:getMin():getZ()
local b3Raw = EgtGetRawPartBBox( PiecesInMachGroup[i].idRaw)
local dRawPosX = b3Raw:getMin():getX()
local dRawPosY = b3Raw:getMin():getY()
local dRawPosZ = b3Raw:getMin():getZ()
local vtMove = Vector3d( dRawPosX - dPartPosX, dRawPosY - dPartPosY, dRawPosZ - dPartPosZ)
EgtMovePartInRawPart( PiecesInMachGroup[i].id, vtMove)
end
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Funzione per trovare nome MachGroup ***
-------------------------------------------------------------------------------------------------------------
local function NewMachGroupName()
local nMachGroupId = EgtGetFirstMachGroup()
if not nMachGroupId then return '1' end
local nMaxMachGroup = 0
while nMachGroupId do
local sMachGroupName = EgtGetMachGroupName( nMachGroupId)
local nMachGroupName = tonumber( sMachGroupName)
if nMachGroupName > nMaxMachGroup then
nMaxMachGroup = nMachGroupName
end
nMachGroupId = EgtGetNextMachGroup( nMachGroupId)
end
return tostring( nMaxMachGroup + 1)
end
-------------------------------------------------------------------------------------------------------------
-- *** Funzione per raggruppamento pezzi ***
-------------------------------------------------------------------------------------------------------------
-- TODO punteggio da verificare!!
-- Calcolo un punteggio di similitudine tra due pezzi
local function CalculateSimilarity( Part1, Part2)
-- peso lati: IN, OUT, LEFT, RIGHT (i lati lunghi hanno più peso rispetto alle teste)
local ProfilesWeights = { 3, 3, 1, 1}
local dScore = 0
for i = 1, 4 do
if Part1.SemiProfiles[i] == Part2.SemiProfiles[i] then
dScore = dScore + ProfilesWeights[i]
end
end
-- punteggio "bonus" se il tipo di pezzo è lo stesso
if Part1.sPieceType and Part2.sPieceType and Part1.sPieceType == Part2.sPieceType then
dScore = dScore + 2
end
return dScore
end
-------------------------------------------------------------------------------------------------------------
-- raggruppamento con vincoli ( lunghezza / numero pezzi)
local function GroupParts( PartsList, sOptimisationType)
-- TIPI DI OTTIMIZZAZIONE (sOptimisationType)
-- 'PIECE' : pezzo singolo
-- 'WINDOW' : ottimizza finestra
-- 'FULL_LIST': ottimizza progetto
local Groups = {}
local Used = {}
for i = 1, #PartsList do
if not Used[i] then
local Group = {}
-- Add the main part
table.insert( Group, PartsList[i])
Used[i] = true
-- se non è ottimizzazione pezzo singolo, cerco altri pezzi che possono essere lavorati nella stessa macchinata
if sOptimisationType ~= 'PIECE' then
-- cerca un altro pezzo compatibile
while true do
local nBestIndex = nil
local nBestScore = -1
for j = 1, #PartsList do
if not Used[j] then
local bCanBeGrouped = not( sOptimisationType == 'WINDOW' and PartsList[i].sWindow ~= PartsList[j].sWindow)
-- se possono essere raggruppati per tipo di ottimizzazione
if bCanBeGrouped then
local VirtualList = WinLib.TableCopyDeep( Group)
table.insert( VirtualList, PartsList[j])
bCanBeGrouped = WinData.VerifyPieces( VirtualList)
-- se possono effettivamente essere messi nella stessa macchinata
if bCanBeGrouped then
-- il punteggio è sempre calcolato rispetto al primo pezzo del gruppo
local nScore = CalculateSimilarity( PartsList[i], PartsList[j])
if nScore > nBestScore then
nBestScore = nScore
nBestIndex = j
end
end
end
end
end
if not nBestIndex then
break
end
-- Add the best matching part
table.insert( Group, PartsList[nBestIndex])
Used[nBestIndex] = true
end
end
table.insert( Groups, Group)
end
end
return Groups
end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento dei pezzi nelle macchinate ***
-------------------------------------------------------------------------------------------------------------
local function CreateMachGroups()
for j = 1, #GROUPS do
-- creo macchinata
local MachGroupName = NewMachGroupName()
local nMachGroup = EgtAddMachGroup( MachGroupName)
-- si setta gruppo appena creato come corrente
EgtSetCurrMachGroup( nMachGroup)
-- si crea il grezzo
CreateRaws( GROUPS[j])
-- allineo i pezzi come orientamento richiesto dalla macchina
AlignRawsToTable( GROUPS[j])
-- aggiungo sovramateriale ai grezzi
AddOverMaterialToRaw( GROUPS[j])
-- si dispongono i pezzi sulla tavola
local bDispOk, sErr = WinData.ExecDisposition( GROUPS[j])
if not bDispOk then
if not sErr then
sErr = 'Errore non gestito in WinData.ExecDisposition'
end
return false
end
-- Impostazione dell'attrezzaggio di default
local bOk = EgtImportSetup()
if not bOk then
EgtImportSetup( 'Default')
end
end
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Esecuzione ***
-------------------------------------------------------------------------------------------------------------
if not GetInfoPieces() then return end
GROUPS = GroupParts( PARTS, WIN.OPT_TYPE)
if not GROUPS or #GROUPS == 0 then
return
end
if not CreateMachGroups() then return end
+77
View File
@@ -0,0 +1,77 @@
-- FeatureData.lua by Egalware s.r.l. 2024/06/18
-- Libreria lettura o calcolo dati e proprietà della feature
-- Tabella per definizione modulo
local FeatureData = {}
-- Carico i dati globali
local WinData = require( 'WinData')
-------------------------------------------------------------------------------------------------------------
-- Recupero dati foro
function FeatureData.GetDrillingData( Proc)
local bOk, ptCentre, vtDir, dRadius = EgtCurveIsACircle( Proc.id)
vtDir = EgtCurveExtrusion( Proc.id)
local Frame = EgtGetGlobFrame( Proc.id)
-- trasformo punti e vettori in globale
ptCentre:toGlob( Frame)
vtDir:toGlob( Frame)
Proc.dDiameter = dRadius * 2
Proc.dLength = abs( EgtCurveThickness( Proc.id)) or 0
Proc.ptCentre = ptCentre
Proc.vtDir = vtDir
Proc.sReferenceSide = EgtGetInfo( Proc.id, 'REFERENCE_SIDE', 's') or nil
return Proc
end
-------------------------------------------------------------------------------------------------------------
-- Recupero dati taglio
function FeatureData.GetCuttingData( Proc)
return Proc
end
-------------------------------------------------------------------------------------------------------------
-- Recupero dati svuotatura
function FeatureData.GetPocketingData( Proc)
return Proc
end
-------------------------------------------------------------------------------------------------------------
-- Recupero dati per fresatura
function FeatureData.GetMillingData( Proc)
return Proc
end
-------------------------------------------------------------------------------------------------------------
-- Recupero dati profilatura
function FeatureData.GetProfilingData( Proc)
-- recupero utensili
Proc.nToolsToUse = EgtGetInfo( Proc.id, 'NTOOLS', 'i') or 0
Proc.sEntityName = EgtGetInfo( Proc.id, 'N', 's') or nil
Proc.Tools = {}
for t = 1, Proc.nToolsToUse do
local Data = {}
Data.sName = EgtGetInfo( Proc.id, 'TOOL_NAME_' .. tostring(t), 's') or 0
Data.dRadialOffset = EgtGetInfo( Proc.id, 'OFFR_' .. tostring(t), 'd') or 0
Data.dLongitudinalOffset = EgtGetInfo( Proc.id, 'OFFL_' .. tostring(t), 'd') or 0
table.insert( Proc.Tools, Data)
end
Proc.sProfileInfo = EgtGetInfo( Proc.id, 'PROFILE_INFO', 's') or nil
Proc.sReferenceSide = EgtGetInfo( Proc.id, 'REFERENCE_SIDE', 's') or ''
Proc.bHeadProfile = Proc.sReferenceSide == 'Head' or Proc.sEntityName == 'Left' or Proc.sEntityName == 'Right'
Proc.bLongitudinalProfile = Proc.sReferenceSide == 'Longitudinal' or Proc.sEntityName == 'In' or Proc.sEntityName == 'Out'
return Proc
end
-------------------------------------------------------------------------------------------------------------
return FeatureData
+41
View File
@@ -0,0 +1,41 @@
-- Identity.lua by Egalware s.r.l. 2024/06/18
-- Libreria Riconoscimento della feature
-- Tabella per definizione modulo
local Identity = {}
---------------------------------------------------------------------
------------------------ STANDARD FEATURES ------------------------
---------------------------------------------------------------------
-- Feature : Drilling
function Identity.IsDrilling( Proc)
return Proc.sType == 'Hole'
end
---------------------------------------------------------------------
-- Feature : Cutting
function Identity.IsCutting( Proc)
return Proc.sType == 'Cut'
end
---------------------------------------------------------------------
-- Feature : Milling
function Identity.IsMilling( Proc)
return Proc.sType == 'Milling'
end
---------------------------------------------------------------------
-- Feature : Pocketing
function Identity.IsPocketing( Proc)
return Proc.sType == 'Pocket'
end
---------------------------------------------------------------------
-- Feature : Profiling
function Identity.IsProfiling( Proc)
return Proc.sType == 'Profiling'
end
---------------------------------------------------------------------
----------------------------- PIECES ------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
return Identity
+440
View File
@@ -0,0 +1,440 @@
-- MachiningLib.lua by Egalware s.r.l. 2024/06/17
-- Libreria ricerca lavorazioni per serramenti
-- Tabella per definizione modulo
local MachiningLib = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
local ID = require( 'Identity')
EgtOutLog( ' MachiningLib started', 1)
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo FRESA con certe caratteristiche
function MachiningLib.FindMill( Proc, ToolSearchParameters)
local ToolInfo = {}
local nBestToolIndex
local dBestToolResidualDepth = 0
for i = 1, #TOOLS do
-- prima verifico che utensile sia compatibile
local bIsToolCompatible = true
if ToolSearchParameters.sName and ToolSearchParameters.sName ~= TOOLS[i].sName then
bIsToolCompatible = false
elseif ToolSearchParameters.dMaxToolDiameter and TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then
bIsToolCompatible = false
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'STANDARD' and ( TOOLS[i].dSideAngle ~= 0 or TOOLS[i].bIsPen) then
bIsToolCompatible = false
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'DOVETAIL' and not TOOLS[i].bIsDoveTail then
bIsToolCompatible = false
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'TSHAPEMILL' and not TOOLS[i].bIsTMill then
bIsToolCompatible = false
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'PEN' and not TOOLS[i].bIsPen then
bIsToolCompatible = false
elseif ToolSearchParameters.sType and TOOLS[i].sType ~= ToolSearchParameters.sType then
-- se sto cercando una fresa che non può lavorare di testa, quelle che lavorano di testa sono comunque ammesse
if TOOLS[i].sType == 'MILL_STD' and ToolSearchParameters.sType == 'MILL_NOTIP' then
bIsToolCompatible = true
else
bIsToolCompatible = false
end
end
-- scelgo il migliore
if bIsToolCompatible then
local dCurrentMaxMatReduction = WinData.COLL_SIC or 5
-- dCurrMachReduction = negativo -> limitare, positivo -> mm extra disponibili
local dCurrentResidualDepth = ToolSearchParameters.dElevation + dCurrentMaxMatReduction - TOOLS[i].dMaxDepth
-- se non ancora trovato, oppure se completo e il migliore fino ad ora non è completo: corrente è il migliore
if not nBestToolIndex or ( dBestToolResidualDepth > 0 and dCurrentResidualDepth <= 0) then
nBestToolIndex = i
dBestToolResidualDepth = dCurrentResidualDepth
-- altrimenti scelgo il migliore
else
-- se entrambi completi
if dBestToolResidualDepth <= 0 and dCurrentResidualDepth <= 0 then
-- se il migliore era su aggregato e corrente montanto direttamente, prediligo utensile montato direttamente
if not TOOLS[i].SetupInfo.bToolOnAggregate and TOOLS[i].SetupInfo.bToolOnAggregate then
nBestToolIndex = i
dBestToolResidualDepth = dCurrentResidualDepth
-- se hanno stesso montaggio
elseif TOOLS[i].SetupInfo.bToolOnAggregate == TOOLS[nBestToolIndex].SetupInfo.bToolOnAggregate then
-- scelgo utensile con indice di bontà utensile calcolato come: lunghezza / massimo materiale / diametro
if ( TOOLS[i].dLength / TOOLS[i].dMaxMaterial) / TOOLS[i].dDiameter < ( TOOLS[nBestToolIndex].dLength / TOOLS[nBestToolIndex].dMaxMaterial) / TOOLS[nBestToolIndex].dDiameter then
nBestToolIndex = i
dBestToolResidualDepth = dCurrentResidualDepth
end
end
-- se entrambi incompleti
elseif dBestToolResidualDepth > 0 and dCurrentResidualDepth > 0 then
--scelgo quello che lavora di più
if dCurrentResidualDepth < dBestToolResidualDepth then
nBestToolIndex = i
dBestToolResidualDepth = dCurrentResidualDepth
end
end
end
end
end
ToolInfo.nToolIndex = nBestToolIndex
ToolInfo.dResidualDepth = dBestToolResidualDepth
return ToolInfo
end
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo LAMA con certe caratteristiche
-- TODO da completare
function MachiningLib.FindBlade( Proc, ToolSearchParameters)
local ToolInfo = {}
-- parametri opzionali
ToolSearchParameters.dElevation = ToolSearchParameters.dElevation or 0
ToolSearchParameters.bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
local nBestToolIndex
for i = 1, #TOOLS do
local bIsToolCompatible = false
-- TODO per il momento si prende la prima lama. Da completare
if TOOLS[i].sFamily == 'SAWBLADE' then
bIsToolCompatible = true
end
if bIsToolCompatible then
nBestToolIndex = i
break
end
end
ToolInfo.nToolIndex = nBestToolIndex
return ToolInfo
end
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo PUNTA A FORARE con certe caratteristiche
-- TODO da fare
function MachiningLib.FindDrill( Proc, ToolSearchParameters)
local ToolInfo = {}
if not ToolSearchParameters.dTolerance then
ToolSearchParameters.dTolerance = 0
end
local nBestToolIndex
for i = 1, #TOOLS do
local bIsToolCompatible = false
-- TODO per il momento si cercano solo le punte. Bisognerebbe valutare anche frese che possono lavorare di testa
if TOOLS[i].sFamily == 'DRILLBIT' then
bIsToolCompatible = true
end
if bIsToolCompatible then
--TODO per il momento si prende il primo utensile con lo stesso diametro, senza considerare altri parametri tipo lunghezza ecc...
if abs( TOOLS[i].dDiameter - ToolSearchParameters.dDiameter) < ToolSearchParameters.dTolerance + GEO.EPS_SMALL * 10 then
if not nBestToolIndex then
nBestToolIndex = i
break
end
end
end
end
ToolInfo.nToolIndex = nBestToolIndex
return ToolInfo
end
-------------------------------------------------------------------------------------------------------------
-- funzione che ritorna fase di lavoro
function MachiningLib.GetPhaseMach( Proc)
local nPhase
-- se info già calcolata
if Proc.nPhase and Proc.nPhase ~= 0 then
nPhase = Proc.nPhase
-- altrimenti si calcola il comportamento standard
else
-- se macchina tipo LINEA
if WinData.MACH_TYPE == 'LINE' then
if Proc.AffectedFaces.bTop then
nPhase = 1
end
if Proc.AffectedFaces.bFront or Proc.AffectedFaces.bLeft then
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 1, 2)
end
if Proc.AffectedFaces.bBack or Proc.AffectedFaces.bRight then
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 2, 1)
end
-- se macchina tipo PANTOGRAFO
else
if Proc.AffectedFaces.bTop or Proc.AffectedFaces.bLeft or Proc.AffectedFaces.bRight then
nPhase = 1
end
if Proc.AffectedFaces.bFront then
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 1, 2)
end
if Proc.AffectedFaces.bBack then
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 2, 1)
end
end
end
return nPhase
end
-------------------------------------------------------------------------------------------------------------
-- funzione che ritorna la distanza di sicurezza da aggiungere alla lavorazione di foratura per evitare colisioni in rapido
function MachiningLib.GetDrillAdditionalSafeDistanceToRaw( Proc, Part, Machining)
-- se non è foro esco subito
if Proc.sType ~= 'Hole' then
return 0
end
local bVirtualToolOk = EgtCAvSetStdTool( TOOLS[Machining.nToolIndex].dLength, TOOLS[Machining.nToolIndex].dDiameter, 0)
local dStartSafetyLength = EgtCAvToolPosBox( Proc.ptCentre, Proc.vtDir, Part.b3RawPart, Proc.vtDir)
-- si riporta valore calcolato sulla punta utensile
dStartSafetyLength = dStartSafetyLength - TOOLS[Machining.nToolIndex].dLength
return dStartSafetyLength + 5 -- si aggiungono 5mm di sicurezza extra
end
-------------------------------------------------------------------------------------------------------------
-- salva in lista globale la lavorazione appena calcolata
function MachiningLib.AddNewMachining( ProcToAdd, MachiningToAdd, AuxiliaryDataToAdd)
-- Controllo parametri obbligatori
if not MachiningToAdd.nType or not MachiningToAdd.nToolIndex or not MachiningToAdd.Geometry or not ProcToAdd.id then
return false
end
-- Drilling
if MachiningToAdd.nType == MCH_MY.DRILLING then
MachiningToAdd.sTypeName = 'Drill_'
-- Milling
elseif MachiningToAdd.nType == MCH_MY.MILLING then
-- se utensile lama
if TOOLS[MachiningToAdd.nToolIndex].sFamily == 'SAWBLADE' then
MachiningToAdd.sTypeName = 'Cut_'
else
MachiningToAdd.sTypeName = 'Mill_'
end
-- Pocketing
elseif MachiningToAdd.nType == MCH_MY.POCKETING then
MachiningToAdd.sTypeName = 'Pocket_'
-- Mortising
elseif MachiningToAdd.nType == MCH_MY.MORTISING then
MachiningToAdd.sTypeName = 'ChSaw_'
end
-- se nome non definito, assegno alla lavorazioen un nome standard
if not MachiningToAdd.sOperationName then
MachiningToAdd.sOperationName = MachiningToAdd.sTypeName .. ( EgtGetName( ProcToAdd.id) or tostring( ProcToAdd.id)) -- TODO serve scrivere faccia? -->> .. '_' .. tostring( MachiningToAdd.Geometry[1][2])
end
if not MachiningToAdd.sToolName then
MachiningToAdd.sToolName = TOOLS[MachiningToAdd.nToolIndex].sName
end
local Machining = {}
Machining.Proc = ProcToAdd
Machining.Machining = MachiningToAdd
Machining.AuxiliaryData = AuxiliaryDataToAdd
table.insert( MACHININGS, Machining)
return true
end
-------------------------------------------------------------------------------------------------------------
-- funzione per aggiungere una nuova lavorazione
function MachiningLib.AddOperation( OperationToInsert)
local nErr
local sErr = ''
local bAreAllMachiningApplyOk = true
-- parametri generali lavorazione
local MachiningParameters = {
{ sName = 'sDepth', nMchParam = MCH_MP.DEPTH_STR},
{ sName = 'bInvert', nMchParam = MCH_MP.INVERT},
{ sName = 'nWorkside', nMchParam = MCH_MP.WORKSIDE},
{ sName = 'nFaceuse', nMchParam = MCH_MP.FACEUSE},
{ sName = 'nSCC', nMchParam = MCH_MP.SCC},
{ sName = 'bToolInvert', nMchParam = MCH_MP.TOOLINVERT},
{ sName = 'sBlockedAxis', nMchParam = MCH_MP.BLOCKEDAXIS},
{ sName = 'sInitialAngles', nMchParam = MCH_MP.INITANGS},
{ sName = 'nHeadSide', nMchParam = MCH_MP.HEADSIDE},
{ sName = 'nSubType', nMchParam = MCH_MP.SUBTYPE},
{ sName = 'dOverlap', nMchParam = MCH_MP.OVERL},
{ sName = 'nStepType', nMchParam = MCH_MP.STEPTYPE},
{ sName = 'dStartSafetyLength', nMchParam = MCH_MP.STARTPOS},
{ sName = 'dReturnPos', nMchParam = MCH_MP.RETURNPOS},
{ sName = 'dRadialOffset', nMchParam = MCH_MP.OFFSR},
{ sName = 'dLongitudinalOffset', nMchParam = MCH_MP.OFFSL},
{ sName = 'dStartSlowLen', nMchParam = MCH_MP.STARTSLOWLEN},
{ sName = 'dEndSlowLen', nMchParam = MCH_MP.ENDSLOWLEN},
{ sName = 'dThrouAddLen', nMchParam = MCH_MP.THROUADDLEN},
{ sName = 'sSystemNotes', nMchParam = MCH_MP.SYSNOTES},
{ sName = 'sUserNotes', nMchParam = MCH_MP.USERNOTES}
}
-- parametri relativi allo step
MachiningParameters.Steps = {
{ sName = 'nStepType', nMchParam = MCH_MP.STEPTYPE},
{ sName = 'dStep', nMchParam = MCH_MP.STEP},
{ sName = 'dSideStep', nMchParam = MCH_MP.SIDESTEP}
}
-- parametri relativi all'approccio
MachiningParameters.LeadIn = {
{ sName = 'nType', nMchParam = MCH_MP.LEADINTYPE},
{ sName = 'dStartAddLength', nMchParam = MCH_MP.STARTADDLEN},
{ sName = 'dTangentDistance', nMchParam = MCH_MP.LITANG},
{ sName = 'dPerpDistance', nMchParam = MCH_MP.LIPERP},
{ sName = 'dElevation', nMchParam = MCH_MP.LIELEV},
{ sName = 'dCompLength', nMchParam = MCH_MP.LICOMPLEN}
}
-- parametri relativi alla retrazione
MachiningParameters.LeadOut = {
{ sName = 'nType', nMchParam = MCH_MP.LEADOUTTYPE},
{ sName = 'dEndAddLength', nMchParam = MCH_MP.ENDADDLEN},
{ sName = 'dTangentDistance', nMchParam = MCH_MP.LOTANG},
{ sName = 'dPerpDistance', nMchParam = MCH_MP.LOPERP},
{ sName = 'dElevation', nMchParam = MCH_MP.LOELEV},
{ sName = 'dCompLength', nMchParam = MCH_MP.LOCOMPLEN}
}
-- parametri da scrivere nelle note utente
local UserNotes = {
{ sName = 'dMaxElev', sMchParam = 'MaxElev'}
}
-- parametri da scrivere nelle note di sistema
local SystemNotes = {
}
local nClonesToAdd = 1
if OperationToInsert.AuxiliaryData.Clones then
nClonesToAdd = #OperationToInsert.AuxiliaryData.Clones
end
for j = 1, nClonesToAdd do
-- creazione lavorazione
local nOperationId = EgtCreateMachining( OperationToInsert.Machining.sOperationName, OperationToInsert.Machining.nType, OperationToInsert.Machining.sToolName)
if nOperationId then
-- impostazione geometria
EgtSetMachiningGeometry( OperationToInsert.Machining.Geometry)
-- impostazione parametri lavorazione
-- TODO scrivere sempre Steps, LeadIn, LeadOut nelle tabelle in modo da non dover controllare ogni volta che ci siano
for k = 1, #MachiningParameters do
local sValue
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j][MachiningParameters[k].sName] then
sValue = OperationToInsert.AuxiliaryData.Clones[j][MachiningParameters[k].sName]
elseif OperationToInsert.Machining[MachiningParameters[k].sName] then
sValue = OperationToInsert.Machining[MachiningParameters[k].sName]
end
if sValue then
EgtSetMachiningParam( MachiningParameters[k].nMchParam, sValue)
end
end
for k = 1, #MachiningParameters.Steps do
local sValue
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j].Steps and OperationToInsert.AuxiliaryData.Clones[j].Steps[MachiningParameters.Steps[k].sName] then
sValue = OperationToInsert.AuxiliaryData.Clones[j].Steps[MachiningParameters.Steps[k].sName]
elseif OperationToInsert.Machining.Steps and OperationToInsert.Machining.Steps[MachiningParameters.Steps[k].sName] then
sValue = OperationToInsert.Machining.Steps[MachiningParameters.Steps[k].sName]
end
if sValue then
EgtSetMachiningParam( MachiningParameters.Steps[k].nMchParam, sValue)
end
end
for k = 1, #MachiningParameters.LeadIn do
local sValue
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j].LeadIn and OperationToInsert.AuxiliaryData.Clones[j].LeadIn[MachiningParameters.LeadIn[k].sName] then
sValue = OperationToInsert.AuxiliaryData.Clones[j].LeadIn[MachiningParameters.LeadIn[k].sName]
elseif OperationToInsert.Machining.LeadIn and OperationToInsert.Machining.LeadIn[MachiningParameters.LeadIn[k].sName] then
sValue = OperationToInsert.Machining.LeadIn[MachiningParameters.LeadIn[k].sName]
end
if sValue then
EgtSetMachiningParam( MachiningParameters.LeadIn[k].nMchParam, sValue)
end
end
for k = 1, #MachiningParameters.LeadOut do
local sValue
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j].LeadOut and OperationToInsert.AuxiliaryData.Clones[j].LeadOut[MachiningParameters.LeadOut[k].sName] then
sValue = OperationToInsert.AuxiliaryData.Clones[j].LeadOut[MachiningParameters.LeadOut[k].sName]
elseif OperationToInsert.Machining.LeadOut and OperationToInsert.Machining.LeadOut[MachiningParameters.LeadOut[k].sName] then
sValue = OperationToInsert.Machining.LeadOut[MachiningParameters.LeadOut[k].sName]
end
if sValue then
EgtSetMachiningParam( MachiningParameters.LeadOut[k].nMchParam, sValue)
end
end
for k = 1, #UserNotes do
local sValue
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j][UserNotes[k].sName] then
sValue = OperationToInsert.AuxiliaryData.Clones[j][UserNotes[k].sName]
elseif OperationToInsert.Machining[UserNotes[k].sName] then
sValue = OperationToInsert.Machining[UserNotes[k].sName]
end
if sValue then
local sUserNotes = ''
sUserNotes = EgtSetValInNotes( sUserNotes, UserNotes[k].sMchParam, sValue)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
end
end
-- parametri da settare nelle note di sistema
-- TODO da decidere quali sono le note da salvare qui. Probabilmente tutte quelle relative all'ordine delle lavorazioni
--if OperationToInsert.Machining.nMachiningOrder then
-- sSystemNotes = EgtSetValInNotes( sSystemNotes, 'MachiningOrder', OperationToInsert.Machining.nMachiningOrder)
--end
for k = 1, #SystemNotes do
local sValue
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j][SystemNotes[k].sName] then
sValue = OperationToInsert.AuxiliaryData.Clones[j][SystemNotes[k].sName]
elseif OperationToInsert.Machining[SystemNotes[k].sName] then
sValue = OperationToInsert.Machining[SystemNotes[k].sName]
end
if sValue then
local sSystemNotes = ''
sSystemNotes = EgtSetValInNotes( sSystemNotes, SystemNotes[k].sMchParam, sValue)
EgtSetMachiningParam( MCH_MP.SYSNOTES, sSystemNotes)
end
end
local b3MachEncumbrance = nil
local bIsApplyOk = MachiningLib.ApplyMachining( true, false)
if not bIsApplyOk then
bAreAllMachiningApplyOk = false
nErr, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nOperationId, false)
else
local nClId = EgtGetFirstNameInGroup( nOperationId, 'CL')
local ptMin = EgtGetInfo( nClId, 'MMIN', 'p')
local ptMax = EgtGetInfo( nClId, 'MMAX', 'p')
-- box percorso lavorazione
if ptMin and ptMax then
local dToolRadius = TOOLS[OperationToInsert.Machining.nToolIndex].dTotDiameter / 2
if dToolRadius then
ptMin = ptMin - Vector3d( dToolRadius, 0, 0)
ptMax = ptMax + Vector3d( dToolRadius, 0, 0)
end
end
b3MachEncumbrance = BBox3d( ptMin, ptMax)
end
return bIsApplyOk, sErr, b3MachEncumbrance
else
return false, 'UNEXPECTED ERROR: Error on creating machining'
end
end
end
-------------------------------------------------------------------------------------------------------------
function MachiningLib.ApplyMachining( bRecalc, bApplyPost)
local bResult = EgtApplyMachining( bRecalc, bApplyPost)
return bResult
end
-------------------------------------------------------------------------------------------------------------
return MachiningLib
+34
View File
@@ -0,0 +1,34 @@
-- WinCAMConst.lua libreria di costanti EgalWare per progetto serramenti 2024/10/07
-- Tavola per definizione modulo (serve ma non usata)
local WinCAMConst = {}
EgtOutLog( 'WinCAMConst started', 1)
-- Funzione per rendere non modificabili le costanti
local protect = function(tbl)
return setmetatable({}, {
__index = tbl,
__newindex = function(t, key, value)
error("attempting to change constant " ..
tbl[1]..tostring(key) .. " to " .. tostring(value), 2)
end
})
end
-- Costanti fasi di lavorazione
MACH_GROUP = {
'MACH_GROUP.',
HEAD_CUT = 1,
FEATURE_BEFORE_PROFILE = 2,
HEAD_PROFILE = 3,
LONG_PROFILE = 4,
MIXED_PROFILE = 5,
FEATURE_AFTER_PROFILE = 6,
STRIPCUT = 7,
PAUSE = 8,
MACH_AFTER_PAUSE = 9
}
MACH_GROUP = protect( MACH_GROUP)
return WinCAMConst
+557
View File
@@ -0,0 +1,557 @@
-- WinExec.lua by Egalware s.r.l. 2024/06/13
-- Libreria esecuzione lavorazioni per Serramenti
-- Tabella per definizione modulo
local WinExec = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
local WinLib = require( 'WinLib')
local ID = require( 'Identity')
local FeatureData = require( 'FeatureData')
local MachiningLib = require( 'MachiningLib')
-- carico librerie di lavorazione
_G.package.loaded.Drilling = nil
_G.package.loaded.Cutting = nil
_G.package.loaded.Pocketing = nil
_G.package.loaded.Milling = nil
_G.package.loaded.Profiling = nil
local Drilling = require( 'Drilling')
local Cutting = require( 'Cutting')
local Pocketing = require( 'Pocketing')
local Milling = require( 'Milling')
local Profiling = require( 'Profiling')
EgtOutLog( ' WinExec started', 1)
EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
-- *** variabili globali ***
-------------------------------------------------------------------------------------------------------------
TOOLS = nil
MACHININGS = nil
-------------------------------------------------------------------------------------------------------------
-- *** COSTANTI *** TODO -> DA SPOSTARE IN WINDATA???
-------------------------------------------------------------------------------------------------------------
TH_DIAMETER_HSK63 = 63
TH_LENGTH_HSK63 = 75
SIDEANGLE_DOVETAIL = 15
-------------------------------------------------------------------------------------------------------------
-- *** funzioni di base ***
-------------------------------------------------------------------------------------------------------------
local function GetToolTypeNameFromToolTypeID( dToolTypeID)
if dToolTypeID == MCH_TY.DRILL_STD then
return 'DRILL_STD', 'DRILLBIT'
elseif dToolTypeID == MCH_TY.DRILL_LONG then
return 'DRILL_LONG', 'DRILLBIT'
elseif dToolTypeID == MCH_TY.SAW_STD then
return 'SAW_STD', 'SAWBLADE'
elseif dToolTypeID == MCH_TY.SAW_FLAT then
return 'SAW_FLAT', 'SAWBLADE'
elseif dToolTypeID == MCH_TY.MILL_STD then
return 'MILL_STD', 'MILL'
elseif dToolTypeID == MCH_TY.MILL_NOTIP then
return 'MILL_NOTIP', 'MILL'
elseif dToolTypeID == MCH_TY.MORTISE_STD then
return 'MORTISE_STD', 'MORTISE'
else
return nil
end
end
-------------------------------------------------------------------------------------------------------------
local function IsToolOk( Tool)
-- controllo che i dati necessari siano impostati
if Tool.dMaxMaterial and Tool.dDiameter and Tool.dLength and Tool.sHead and Tool.sUUID then
-- se DRILLBIT non ho altri dati
if Tool.sFamily == 'DRILLBIT' then
return true
-- altrimenti controllo dati aggiuntivi altre famiglie di utensili
elseif Tool.sFamily == 'MORTISE' then
if Tool.dCornerRadius then
return true
end
else
if Tool.dThickness then
return true
end
end
end
return false
end
-------------------------------------------------------------------------------------------------------------
function WinExec.GetToolsFromDB()
-- TODO gli utensili profilati devono essere messi in una lista a parte ad accesso diretto TOOLS['Prof1'] in modo da non dover scorrere la lista
-- dato che saranno molti e l'applicazione sarà diretta. Non serve ciclarli
-- creo lista globale utensili disponibili
TOOLS = {}
-- lista appoggio utensile
local Tool = {}
-- recupero tutti gli utensili : punte a forare, lame, frese e motoseghe
Tool.sName = EgtTdbGetFirstTool( MCH_TF.DRILLBIT + MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
while Tool.sName ~= '' do
-- imposto utensile come corrente per recuperarne i dati
EgtTdbSetCurrTool( Tool.sName)
-- verifico se utensile disponibile in attrezzaggio attuale e che abbia un tipo ben definito
local bToolLoadedOnSetup, sToolTCPos = EgtFindToolInCurrSetup( Tool.sName)
local nToolTypeId = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
local sToolType, sToolFamily = GetToolTypeNameFromToolTypeID( nToolTypeId)
-- se verifica condizioni minime, recupero tutti gli altri dati
if bToolLoadedOnSetup and sToolType then
Tool.sTcPos = sToolTCPos
Tool.sFamily = sToolFamily
Tool.sType = sToolType
Tool.nTypeId = nToolTypeId
Tool.dMaxMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
Tool.dDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
Tool.dTotDiameter = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
Tool.dLength = EgtTdbGetCurrToolParam( MCH_TP.LEN)
Tool.dSpeed = EgtTdbGetCurrToolParam( MCH_TP.SPEED)
Tool.bIsCCW = Tool.dSpeed < 0
Tool.Feeds = {}
Tool.Feeds.dFeed = EgtTdbGetCurrToolParam( MCH_TP.FEED)
Tool.Feeds.dStartFeed = EgtTdbGetCurrToolParam( MCH_TP.STARTFEED)
Tool.Feeds.dEndFeed = EgtTdbGetCurrToolParam( MCH_TP.ENDFEED)
Tool.Feeds.dTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
Tool.sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
Tool.SetupInfo = {}
Tool.SetupInfo = WinData.GetSetupInfo( {sHead = Tool.sHead, sTcPos = Tool.sTcPos})
Tool.sUUID = EgtTdbGetCurrToolParam( MCH_TP.UUID)
Tool.sUserNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
Tool.dMaxDepth = EgtTdbGetCurrToolMaxDepth() or Tool.dMaxMaterial
Tool.ToolHolder = {}
Tool.ToolHolder.dDiameter = EgtTdbGetCurrToolThDiam() or TH_DIAMETER_HSK63 -- diametro standard HSK63
Tool.ToolHolder.dLength = EgtTdbGetCurrToolThLength() or TH_LENGTH_HSK63 -- lunghezza standard HSK63
-- parametri scritti nelle note
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE')
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
if sToolFamily ~= 'DRILLBIT' then
Tool.dThickness = EgtTdbGetCurrToolParam( MCH_TP.THICK)
Tool.dLongitudinalOffset = EgtTdbGetCurrToolParam( MCH_TP.LONOFFSET)
Tool.dRadialOffset = EgtTdbGetCurrToolParam( MCH_TP.RADOFFSET)
-- recupero parametri propri delle frese
if sToolFamily == 'MILL' then
Tool.dStemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or Tool.ToolHolder.dDiameter -- se non settato, considero diametro come ToolHolder
Tool.dSideAngle = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or 0
-- verifico che parametri siano compatibili con una fresa a coda di rondine ( angolo di fianco standard Coda di rondine -> 15°)
Tool.bIsDoveTail = Tool.Type == 'MILL_NOTIP' and abs( abs( Tool.dSideAngle) - SIDEANGLE_DOVETAIL) < 1
-- verifico che sia una fresa tipo T-Mill o BlockHaus
Tool.dSideDepth = EgtGetValInNotes( Tool.sUserNotes, 'SIDEDEPTH') or 0 -- se non settato nell'utensile, dico che non ha massimo affondamento laterale
Tool.bIsTMill = Tool.dSideDepth > 0
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or ( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero metà del tagliente
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or floor( Tool.dDiameter / 3) -- se non settato nell'utensile, considero metà del diametro
Tool.bIsPen = abs( Tool.dSpeed) < 5
-- recupero parametri propri delle lame
elseif sToolFamily == 'SAWBLADE' then
Tool.bIsUsedForLongCut = EgtGetValInNotes( Tool.sUserNotes, 'LONGCUT') == 1 or false -- false coem valore di default
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or Tool.dThickness -- se non settato nell'utensile, considero lo spessore lama
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or Tool.dMaxMaterial -- se non settato nell'utensile, considero un quarto del diametro
-- recupero parametri propri delle motoseghe
elseif sToolFamily == 'MORTISE' then
Tool.dDistance = EgtTdbGetCurrToolParam( MCH_TP.DIST) or 90 -- 90mm dimensione standard aggregato catena
Tool.bIsMortise = EgtGetValInNotes( Tool.sUserNotes, 'MORTISE') == 1
Tool.bIsChainSaw = not Tool.bIsMortise
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or floor( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero un terzo della lunghezza
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or ( Tool.dThickness - 1) -- se non settato nell'utensile, considero spessore catena meno 1mm di sicurezza
Tool.dCornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD)
Tool.dWidth = Tool.dDiameter
end
end
-- se tutti i dati necessari sono disponibili, inserisco utensile nella lista globale degli utensili disponibili
if IsToolOk( Tool) then
table.insert( TOOLS, Tool)
-- altrimenti scrivo nel log che l'utensile non è conforme
else
EgtOutLog( '*** ' .. Tool.sName .. ' : NOT-COMPLIANT ***', 1)
end
-- reset dati
Tool = {}
end
-- recupero utensile successivo ( punte a forare, lame, frese e motoseghe)
Tool.sName = EgtTdbGetNextTool( MCH_TF.DRILLBIT + MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
end
end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento delle lavorazioni nelle travi ***
-------------------------------------------------------------------------------------------------------------
local function CollectFeatures( vProc, Part, nIndexPart)
-- recupero le feature
local LayerId = {}
LayerId[1] = WinLib.GetAddGroup( Part.id)
LayerId[2] = EgtGetFirstNameInGroup( Part.id or GDB_ID.NULL, 'Processings')
for nInd = 1, 2 do
local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL)
while ProcId do
local nEntType = EgtGetType( ProcId)
if nEntType == GDB_TY.SRF_MESH or nEntType == GDB_TY.EXT_TEXT or
nEntType == GDB_TY.CRV_LINE or nEntType == GDB_TY.CRV_ARC or nEntType == GDB_TY.CRV_BEZ or nEntType == GDB_TY.CRV_COMPO then
local sType = EgtGetInfo( ProcId, 'FEATURE_TYPE', 's')
local nDo = EgtGetInfo( ProcId, 'DO', 'i') or 1
if sType and nDo == 1 then
local Proc = {}
Proc.idPart = Part.id
Proc.nIndexPart = nIndexPart
Proc.id = ProcId
Proc.nFlg = 1
Proc.sType = sType
Proc.b3Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
Proc.nPhase = EgtGetInfo( ProcId, 'PHASE', 'i') or nil
-- se esiste la geometria
if Proc.b3Box and not Proc.b3Box:isEmpty() then
-- calcolo dati specifici per tipologia di feature / lavorazione
-- se foro
if ID.IsDrilling( Proc) then
Proc = FeatureData.GetDrillingData( Proc)
end
-- se taglio
if ID.IsCutting( Proc) then
Proc = FeatureData.GetCuttingData( Proc)
end
-- se fresatura
if ID.IsMilling( Proc) then
Proc = FeatureData.GetMillingData( Proc)
end
-- se svuotatura
if ID.IsPocketing( Proc) then
Proc = FeatureData.GetPocketingData( Proc)
end
-- se profilatura
if ID.IsProfiling( Proc) then
Proc = FeatureData.GetProfilingData( Proc)
end
-- informazioni facce
Proc.AffectedFaces = WinLib.GetAffectedFaces( Proc, Part)
-- inserisco feature in lista
table.insert( vProc, Proc)
else
Proc.nFlg = 0
table.insert( vProc, Proc)
EgtOutLog( ' Feature ' .. tostring( Proc.idFeature) .. ' is empty (no geometry)')
end
end
end
ProcId = EgtGetNext( ProcId)
end
end
return vProc
end
-------------------------------------------------------------------------------------------------------------
local function GetFeatureInfoAndDependency( vProc, Part)
-- ciclo tutte le feature
for i = 1, #vProc do
local Proc = vProc[i]
-- controllo la feature con tutte le altre per recuperare le dipendenze
for j = 1, #vProc do
-- non si controlla la feature con se stessa
if i ~= j then
local ProcB = vProc[j]
-- TODO dipendenze da controllare :
-- * gruppo di forature con aggregato 2/3 uscite
-- * Se 'Left' e 'Out' hanno stesso profilo, vanno concatenati (anche 'Right' se consentito dalla macchina)
end
end
end
return vProc
end
-------------------------------------------------------------------------------------------------------------
-- ottimizza le lavorazioni, considerando di ridurre i cambi utensile
local function SortByChangeToolOpt( MACHININGS)
local vProcToSortToolOpt = {}
vProcToSortToolOpt = MACHININGS
for i = 1, #vProcToSortToolOpt do
for j = i + 1, #vProcToSortToolOpt do
-- se sono su stessa fase
if vProcToSortToolOpt[i].AuxiliaryData.nPhase == vProcToSortToolOpt[j].AuxiliaryData.nPhase then
-- se stesso utensile
if vProcToSortToolOpt[i].Machining.nToolIndex == vProcToSortToolOpt[j].Machining.nToolIndex then
if i + 1 == j then
-- il confronto riparte dall'ultimo spostato
i = j
else
-- sposto lavorazione confrontata dopo la principale
WinLib.ChangeElementPositionInTable( vProcToSortToolOpt, j, i+1)
-- il confronto riparte dall'ultimo spostato
i = j
end
end
end
end
end
return vProcToSortToolOpt
end
-------------------------------------------------------------------------------------------------------------
-- Ordina le feature in base a fase di lavorazione
-- L'ordine è indicativamente:
-- 1) Tagli di testa
-- 2) Fori
-- 3) Scassi serratura/maniglia
-- 4) Profili testa / Minizinken
-- 5) Fori per spine dopo profilo di testa
-- 6) Profili longitudinali
-- 7) Passate pulitura per cambio profilo
-- 8) Incontri/scontri (encounter/clash)
-- 9) Listello ferma-vetro
-- 10) Pausa
-- 11) Lavorazioni dopo rimozione ferma-vetro
-- TODO Verificare se assegnare le fasi già quando si mette la lavorazione e ordinare solo in base alla fase di lavoro.
-- TODO il punto 11) deve essere diviso in altri punti in base alle lavorazioni. Per adesso è un gruppo generico.
-- TODO Ridefinire le fasi, prevedere anche la fase di cambio pinzaggio
local function OrderMachining( MACHININGS)
local vProcToSort = MACHININGS
-- funzione di confronto. TRUE = B1 prima di B2. FALSE = B2 prima di B1
local function CompareFeatures( B1, B2)
-- se secondo disabilitato, va lasciato dopo
if B1.Proc.nFlg ~= 0 and B2.Proc.nFlg == 0 then
return true
elseif B1.AuxiliaryData.nPhase < B2.AuxiliaryData.nPhase then
return true
elseif B1.AuxiliaryData.nPhase > B2.AuxiliaryData.nPhase then
return false
elseif B1.Machining.Geometry == B2.Machining.Geometry then
return B1.AuxiliaryData.nIndexMachining < B2.AuxiliaryData.nIndexMachining
elseif B1.AuxiliaryData.bIsProfiling and B2.AuxiliaryData.bIsDrilling and B2.AuxiliaryData.bExecAfterProfile then
return true
elseif B1.AuxiliaryData.bIsDrilling and B1.AuxiliaryData.bExecAfterProfile and B2.AuxiliaryData.bIsProfiling then
return false
elseif B1.AuxiliaryData.bIsDrilling and B2.AuxiliaryData.bIsProfiling then
return true
elseif B2.AuxiliaryData.bIsDrilling and B1.AuxiliaryData.bIsProfiling then
return false
elseif B1.AuxiliaryData.bIsProfiling and B2.AuxiliaryData.bIsProfiling then
-- profiling Generic sempre per ultimi
if B1.Proc.sProfileInfo == 'Generic' and B2.Proc.sProfileInfo ~= 'Generic' then
return false
elseif B2.Proc.sProfileInfo == 'Generic' and B1.Proc.sProfileInfo ~= 'Generic' then
return true
-- profiling Mixed dopo le profilature standard
elseif B1.Proc.sProfileInfo == 'Mixed' and B2.Proc.sProfileInfo ~= 'Mixed' then
return false
elseif B2.Proc.sProfileInfo == 'Mixed' and B1.Proc.sProfileInfo ~= 'Mixed' then
return true
-- negli altri casi si ordina solo in base alla posizione
elseif B1.Proc.b3Box:getCenter():getX() - B2.Proc.b3Box:getCenter():getX() < 10 * GEO.EPS_SMALL then
return EgtIf( B1.AuxiliaryData.nPhase == 1, true, false) -- se arrivati a questo controllo, la fase di lavorazione di entrambe è la stessa, quindi mi basta controllarne una
else
return EgtIf( B1.AuxiliaryData.nPhase == 1, false, true) -- se arrivati a questo controllo, la fase di lavorazione di entrambe è la stessa, quindi mi basta controllarne una
end
elseif B1.AuxiliaryData.bIsDrilling and B2.AuxiliaryData.bIsDrilling then
if B1.Proc.b3Box:getMin():getX() < B2.Proc.b3Box:getMin():getX() then
return true
else
return false
end
else
return false
end
end
-- test della funzione di ordinamento
if EgtGetDebugLevel() >= 3 then
EgtOutLog( ' CompareFeatures Test ')
local bCompTest = true
for i = 1, #vProcToSort do
for j = i + 1, #vProcToSort do
local bComp1 = CompareFeatures( vProcToSort[i], vProcToSort[j])
local bComp2 = CompareFeatures( vProcToSort[j], vProcToSort[i])
if bComp1 == bComp2 then
bCompTest = false
EgtOutLog( string.format( ' ProcId : %d vs %d --> ERROR', vProcToSort[i].Proc.id, vProcToSort[j].Proc.id))
end
end
end
if bCompTest then
EgtOutLog( ' ALL OK')
end
end
-- eseguo un primo ordinamento
table.sort( vProcToSort, CompareFeatures)
-- ordino per ottimizzare cambio utensile
-- MACHININGS = SortByChangeToolOpt( MACHININGS)
return true
end
-------------------------------------------------------------------------------------------------------------
-- applica le lavorazioni
local function AddMachinings( vProc, PARTS)
local bMachiningOk = true
for nFeatureIndex = 1, #vProc do
local Proc = vProc[nFeatureIndex]
local Part = PARTS[vProc[nFeatureIndex].nIndexPart]
if ID.IsDrilling( Proc) then
bMachiningOk = Drilling.Make( Proc, Part)
end
-- se taglio
if ID.IsCutting( Proc) then
bMachiningOk = Cutting.Make( Proc, Part)
end
-- se fresatura
if ID.IsMilling( Proc) then
bMachiningOk = Milling.Make( Proc, Part)
end
-- se svuotatura
if ID.IsPocketing( Proc) then
bMachiningOk = Pocketing.Make( Proc, Part)
end
-- se profilatura
if ID.IsProfiling( Proc) then
bMachiningOk = Profiling.Make( Proc, Part)
end
end
return bMachiningOk
end
-------------------------------------------------------------------------------------------------------------
local function PrintFeatures( vProc, PARTS)
EgtOutLog( ' === PARTS ====')
for i = 1, #PARTS do
EgtOutLog( ' RawBox(' .. tostring( i) .. ') =' .. tostring( PARTS[i].RawBox))
end
EgtOutLog( ' === FEATURES ====')
for i = 1, #vProc do
local Proc = vProc[i]
local sOut = string.format( 'Id=%3d Flg=%2d Type=%s', Proc.id, Proc.nFlg, Proc.sType)
EgtOutLog( sOut)
end
end
-------------------------------------------------------------------------------------------------------------
local function UpdateRawPosition( PARTS)
for i = 1, #PARTS do
PARTS[i].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
PARTS[i].b3RawPart = EgtGetRawPartBBox( PARTS[i].idRaw)
end
end
-------------------------------------------------------------------------------------------------------------
local function CheckAndMovePawPart( nIdRawToMove, vtMove)
EgtMoveRawPart( nIdRawToMove, vtMove)
end
-------------------------------------------------------------------------------------------------------------
function WinExec.ProcessFeatures( PARTS)
-- ciclo sui pezzi
local nTotErr = 0
local Stats = {}
local vProc = {}
MACHININGS = {}
-- aggiorno posizione grezzi dopo disposizione
EgtSetCurrPhase( 1)
UpdateRawPosition( PARTS)
-- si recuperano tutte le feature di tutti i pezzi in una lista unica
for nPart = 1, #PARTS do
-- recupero le feature di lavorazione della trave
vProc = CollectFeatures( vProc, PARTS[nPart], nPart)
-- recupero informazioni ausiliarie feature e dipendenze tra feature dello stesso pezzo
vProc = GetFeatureInfoAndDependency( vProc, PARTS[nPart])
end
-- debug
if EgtGetDebugLevel() >= 1 then
PrintFeatures( vProc, PARTS)
end
EgtOutLog( ' *** AddMachinings ***', 1)
-- esegue le lavorazioni e le salva in lista
AddMachinings( vProc, PARTS)
-- ordina le lavorazioni
OrderMachining( MACHININGS)
for i = 1, #MACHININGS do
if MACHININGS[i].AuxiliaryData.nPhase == 1 then
-- aggiunge effettivamente la lavorazione e restituisce gli ingombri
local bIsApplyOk, sErr, b3MachEncumbrance = MachiningLib.AddOperation( MACHININGS[i]) -- TODO ingombro lavorazione mi restituisce dati sbagliati. C'è un riferimento?
-- se feature di testa, sposto testa in base a ingombro lavorazione
if MACHININGS[i].Proc.bHeadProfile and b3MachEncumbrance then
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase1.dOffsetX = b3MachEncumbrance:getMax():getX() - PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMin():getX() + 5
end
end
end
-- TODO lo spostamento, oltre a controllare le collisioni con il profilo di testa, deve anche considerare il pinzaggio del pezzo nel suo insieme?
-- Es.: basterebbe aggiungere un offset di 50mm per la testa, ma se metto 60mm, posso utilizzare una morsa in più che altrimenti avrei dovuto togliere per una collisione con una svuotatura
-- sposto pezzo per permettere pinzaggio migliore e non aver colisione in testa
for i = 1, #PARTS do
-- TODO controllare calcolo ingombro
local vtMove = Vector3d( - PARTS[i].DispOffsets.Phase1.dOffsetX, 0, 0)
if vtMove ~= V_NULL() then
CheckAndMovePawPart( PARTS[i].idRaw, vtMove)
end
end
-- scrivo lavorazioni seconda fase
EgtSetCurrPhase( 2)
UpdateRawPosition( PARTS)
for i = 1, #MACHININGS do
if MACHININGS[i].AuxiliaryData.nPhase == 2 then
-- aggiunge effettivamente la lavorazione
local bIsApplyOk, sErr, b3MachEncumbrance = MachiningLib.AddOperation( MACHININGS[i]) -- TODO ingombro lavorazione mi restituisce dati sbagliati. C'è un riferimento?
-- se feature di testa, sposto testa in base a ingombro lavorazione
if MACHININGS[i].Proc.bHeadProfile and b3MachEncumbrance then
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase2.dOffsetX = PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMax():getX() - b3MachEncumbrance:getMin():getX() + 5
end
end
end
-- sposto pezzo per permettere pinzaggio migliore e non aver colisione in testa
for i = 1, #PARTS do
-- TODO controllare calcolo ingombro
local vtMove = Vector3d( PARTS[i].DispOffsets.Phase2.dOffsetX, 0, 0)
if vtMove ~= V_NULL() then
CheckAndMovePawPart( PARTS[i].idRaw, vtMove)
end
end
EgtOutLog( ' *** End AddMachinings ***', 1)
-- Aggiornamento finale di tutto
EgtSetCurrPhase( 1)
local bApplOk, sApplErrors, sApplWarns = EgtApplyAllMachinings()
if not bApplOk then
nTotErr = nTotErr + 1
table.insert( Stats, {nErr = 1, sMsg=sApplErrors})
end
return ( nTotErr == 0), Stats
end
-------------------------------------------------------------------------------------------------------------
return WinExec
+176
View File
@@ -0,0 +1,176 @@
-- WinLib.lua by Egalware s.r.l. 2024/06/14
-- Libreria globale per Serramenti
-- Tabella per definizione modulo
local WinLib = {}
-- Include
require( 'EgtBase')
local WinData = require( 'WinData')
EgtOutLog( ' WinLib started', 1)
-------------------------------------------------------------------------------------------------------------
-- restituisce le facce della parte interessate dalla feature Proc
function WinLib.GetAffectedFaces( Proc, Part)
local vtFacesAffected = { bTop = false, bBottom = false, bFront = false, bBack = false, bLeft = false, bRight = false}
if Proc.b3Box and not Proc.b3Box:isEmpty() then
-- caso speciale foro
if Proc.sType == 'Hole' and Proc.sReferenceSide then
if Proc.sReferenceSide == Part.SideNames.sLeft then
vtFacesAffected.bLeft = true
elseif Proc.sReferenceSide == Part.SideNames.sRight then
vtFacesAffected.bRight = true
elseif Proc.sReferenceSide == Part.SideNames.sFront then
vtFacesAffected.bFront = true
elseif Proc.sReferenceSide == Part.SideNames.sBack then
vtFacesAffected.bBack = true
end
-- caso speciale profili per pezzo con cambio-profilo
elseif Proc.sType == 'Profiling' and Proc.sProfileInfo == 'Mixed' then
if Proc.sReferenceSide == Part.SideNames.sLeft then
vtFacesAffected.bLeft = true
elseif Proc.sReferenceSide == Part.SideNames.sRight then
vtFacesAffected.bRight = true
elseif Proc.sReferenceSide == Part.SideNames.sFront then
vtFacesAffected.bFront = true
elseif Proc.sReferenceSide == Part.SideNames.sBack then
vtFacesAffected.bBack = true
end
-- caso speciale profili
elseif Proc.sType == 'Profiling' then
if not Part.SideNames then
Part.SideNames = {}
end
-- quando si settano i lati interessati, mi salvo anche il nome.
-- se c'è una rotazione di 180°, potrebbe essere che il lato LEFT del pezzo corrisponda al lato RIGHT della lavorazione. Stesso per IN/OUT
if Proc.b3Box:getMax():getX() < Part.b3Part:getCenter():getX() then
vtFacesAffected.bLeft = true
Part.SideNames.sLeft = Proc.sEntityName
elseif Proc.b3Box:getMin():getX() > Part.b3Part:getCenter():getX() then
vtFacesAffected.bRight = true
Part.SideNames.sRight = Proc.sEntityName
elseif Proc.b3Box:getMax():getY() < Part.b3Part:getCenter():getY() then
vtFacesAffected.bFront = true
Part.SideNames.sFront = Proc.sEntityName
elseif Proc.b3Box:getMin():getY() > Part.b3Part:getCenter():getY() then
vtFacesAffected.bBack = true
Part.SideNames.sBack = Proc.sEntityName
end
-- caso standard
else
if Proc.b3Box:getMax():getZ() > Part.b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
vtFacesAffected.bTop = true
end
if Proc.b3Box:getMin():getZ() < Part.b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
vtFacesAffected.bBottom = true
end
if Proc.b3Box:getMin():getY() < Part.b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
vtFacesAffected.bFront = true
end
if Proc.b3Box:getMax():getY() > Part.b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
vtFacesAffected.bBack = true
end
if Proc.b3Box:getMin():getX() < Part.b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
vtFacesAffected.bLeft = true
end
if Proc.b3Box:getMax():getX() > Part.b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
vtFacesAffected.bRight = true
end
end
end
return vtFacesAffected
end
-------------------------------------------------------------------------------------------------------------
function WinLib.SwapElements( Table, Pos1, Pos2)
Table[Pos1], Table[Pos2] = Table[Pos2], Table[Pos1]
return Table
end
-------------------------------------------------------------------------------------------------------------
function WinLib.ChangeElementPositionInTable( Table, nCurrentPosition, nTargetPosition)
-- se indici uguali esco subito
if nTargetPosition == nCurrentPosition then
return Table
end
local Item = Table[nCurrentPosition]
if nTargetPosition > nCurrentPosition then
nTargetPosition = nTargetPosition - 1
end
table.remove( Table, nCurrentPosition)
table.insert( Table, nTargetPosition, Item)
return Table
end
-------------------------------------------------------------------------------------------------------------
function WinLib.GetAddGroup( PartId)
-- recupero il nome del gruppo di lavoro corrente
local sMchGrp = EgtGetMachGroupName( EgtGetCurrMachGroup() or GDB_ID.NULL)
if not sMchGrp then
return nil, nil
end
-- cerco il gruppo aggiuntivo omonimo nel pezzo e se esiste lo restituisco
local AddGrpId = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, sMchGrp)
-- restituisco Id e Nome
return AddGrpId, sMchGrp
end
-------------------------------------------------------------------------------------------------------------
function WinLib.GetPathMinRadius( IdCurve)
local dSmallRadius = 9999
local InitIdEntity, LastIdEntity = EgtCurveDomain(IdCurve)
for i = InitIdEntity, LastIdEntity do
local dRadius = EgtCurveCompoRadius( IdCurve, i)
-- se è un arco ed è più piccolo del minimo, lo salvo
if dRadius and dRadius > 0 and dRadius < dSmallRadius then
dSmallRadius = dRadius
end
end
return dSmallRadius
end
-------------------------------------------------------------------------------------------------------------
--- copia una tabella lua in modo ricorsivo, ossia mantiene indipendenti anche tutte le sottotabelle
--- ATTENZIONE: in caso di modifiche vanno gestiti anche i tipi custom; sarebbe meglio metterla nel LuaLibs
function WinLib.TableCopyDeep( OriginalTable)
-- controllo se oggetto passato è valido, altrimenti errore. Non deve mai succedere
if not OriginalTable then
error( "TableCopyDeep : can't copy nil object")
end
local CopiedTable = {}
for key, value in pairs( OriginalTable) do
if type( value) == "table" then
if isBBox3d( value) then
CopiedTable[ key] = BBox3d( value)
elseif isColor3d( value) then
CopiedTable[ key] = Color3d( value)
elseif isFrame3d( value) then
CopiedTable[ key] = Frame3d( value)
elseif isPoint3d( value) then
CopiedTable[ key] = Point3d( value)
elseif isQuaternion( value) then
CopiedTable[ key] = Quaternion( value)
elseif isVector3d( value) then
CopiedTable[ key] = Vector3d( value)
else
CopiedTable[ key] = BeamLib.TableCopyDeep( value)
end
else
CopiedTable[ key] = value
end
end
return CopiedTable
end
-------------------------------------------------------------------------------------------------------------
return WinLib
+328
View File
@@ -0,0 +1,328 @@
-- Process.lua by Egalware s.r.l. 2024/06/13
-- Gestione calcolo disposizione e lavorazioni per serramenti
-- Si opera sulla macchina corrente
-- 2024/06/13 PRIMA VERSIONE
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- TODO da cancellare quando verrà passato automaticamente da programma
local WIN = {}
WIN.BASEDIR = 'C:\\EgtData\\Window\\CAMAuto'
-- Imposto direttorio libreria specializzata per serramenti
EgtAddToPackagePath( WIN.BASEDIR .. '\\LuaLibs\\?.lua')
-- Imposto direttorio strategie. N.B. Le strategie dovranno essere caricate con il nome del direttorio padre
EgtAddToPackagePath( WIN.BASEDIR .. '\\Strategies\\?.lua')
-- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi
local sMachDir = EgtGetCurrMachineDir()
if not sMachDir then
EgtOutBox( 'Errore nel caricamento della macchina corrente', 'Lavora Serramenti', 'ERROR')
return
end
if not EgtExistsFile( sMachDir .. '\\Window\\WinData.lua') then
EgtOutBox( 'La macchina corrente non è configurata per lavorare serramenti', 'Lavora Serramenti', 'ERROR')
return
end
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
EgtRemoveBaseMachineDirFromPackagePath()
EgtAddToPackagePath( sMachDir .. '\\Window\\?.lua')
-- Segnalazione avvio
EgtOutLog( '*** Window Process Start ***', 1)
-- Carico le librerie
_G.package.loaded.WinData = nil
_G.package.loaded.WinExec = nil
_G.package.loaded.WinLib = nil
_G.package.loaded.FeatureData = nil
_G.package.loaded.MachiningLib = nil
local WinExec = require( 'WinExec')
-- Carico i dati globali
local WinData = require( 'WinData')
-- Variabili globali
PARTS = {}
-- Colore del grezzo
local ColA = Color3d( 255, 165, 0, 30)
-------------------------------------------------------------------------------------------------------------
-- *** Recupero i pezzi da processare ***
-------------------------------------------------------------------------------------------------------------
local function MyProcessInputData()
-- Recupero le travi selezionate
local nId = EgtGetFirstSelectedObj()
while nId do
local nPartId = EgtGetParent( EgtGetParent( nId or GDB_ID.NULL) or GDB_ID.NULL)
if nPartId then
local bFound = false
for i = 1, #PARTS do
if PARTS[i].id == nPartId then
bFound = true
break
end
end
if not bFound then
table.insert( PARTS, { nInd = #PARTS + 1, id = nPartId, sName = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))})
end
end
nId = EgtGetNextSelectedObj()
end
if #PARTS == 0 then
EgtOutBox( 'Non sono state selezionati pezzi', 'Lavora Pezzi', 'ERROR')
return false
else
-- recupero tutte le dimensioni necessarie
local sOut = ''
for i = 1, #PARTS do
PARTS[i].b3Raw = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw') or GDB_ID.NULL, GDB_BB.STANDARD)
PARTS[i].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
local idFrame = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw'), 'AuxFrame')
PARTS[i].frame = EgtFR( idFrame)
sOut = sOut .. PARTS[i].sName .. ', '
end
sOut = sOut:sub( 1, -3)
EgtOutLog( 'Pezzi selezionati : ' .. sOut, 1)
end
EgtDeselectAll()
return true
end
-------------------------------------------------------------------------------------------------------------
local function GetDataConfig()
-- recupero utensili dal magazzino
WinExec.GetToolsFromDB()
-- TODO da gestire eventuali errori bloccanti
return true
end
-------------------------------------------------------------------------------------------------------------
local function GetDispOffsetFromNotes( nPieceIndex)
local bAllOffsetsAreOk = false
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_1', 'd')
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_1', 'd')
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_2', 'd')
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_2', 'd')
-- controllo se tutti gli offset siano settati
if PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ and
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ then
bAllOffsetsAreOk = true
end
return bAllOffsetsAreOk
end
-------------------------------------------------------------------------------------------------------------
local function GetDispOffsetFromInput( nPieceIndex)
-- assegno alle stringhe i valori letti, in modo che vengano proposti quelli nel dialogo
local sOffYPh1 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY, tostring( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY), tostring( PARTS[nPieceIndex].dPartWidth / 2))
local sOffZPh1 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ, tostring( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ), '0')
local sOffYPh2 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY, tostring( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY), tostring( PARTS[nPieceIndex].dPartWidth / 2))
local sOffZPh2 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ, tostring( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ), '0')
local vInp = EgtDialogBox( 'Dati di disposizione pezzo: ' .. PARTS[nPieceIndex].sName,
{'Sporgenza laterale FASE1', sOffYPh1}, {'Posizione Z FASE1', sOffZPh1},
{'Sporgenza laterale FASE2', sOffYPh2}, {'Posizione Z FASE2', sOffZPh2})
if not vInp or #vInp == 0 then
return false
end
-- salvo input nei valori che utilizzerò dopo
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = tonumber( vInp[1])
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = tonumber( vInp[2])
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = tonumber( vInp[3])
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = tonumber( vInp[4])
return true
end
---------------------------------------------------------------------
-- Crea il grezzo che verrà messo in macchina
---------------------------------------------------------------------
local function AddOverMaterialToRaw( PARTS)
for i = 1, #PARTS do
-- prima di aggiungere sovramateriale al grezzo, calcolo dimensioni del finito
local b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
PARTS[i].b3Part = b3Part
PARTS[i].dPartLength = PARTS[i].b3Part:getDimX()
PARTS[i].dPartWidth = PARTS[i].b3Part:getDimY()
PARTS[i].dPartHeight = PARTS[i].b3Part:getDimZ()
-- recupero sovramateriale
PARTS[i].RawOffset = {}
-- recupero info sovramateriale
PARTS[i].RawOffset.dOverMatIn = EgtGetInfo( PARTS[i].id, 'OVERMAT_IN', 'd') or 5
PARTS[i].RawOffset.dOverMatOut = EgtGetInfo( PARTS[i].id, 'OVERMAT_OUT', 'd') or 5
PARTS[i].RawOffset.dOverMatLeft = EgtGetInfo( PARTS[i].id, 'OVERMAT_LEFT', 'd') or 5
PARTS[i].RawOffset.dOverMatRight = EgtGetInfo( PARTS[i].id, 'OVERMAT_RIGHT', 'd') or 5
PARTS[i].dRawLength = PARTS[i].RawOffset.dOverMatLeft + PARTS[i].dPartLength + PARTS[i].RawOffset.dOverMatRight
PARTS[i].dRawWidth = PARTS[i].RawOffset.dOverMatOut + PARTS[i].dPartWidth + PARTS[i].RawOffset.dOverMatIn
PARTS[i].dRawHeight = PARTS[i].dPartHeight
EgtModifyRawPartSize( PARTS[i].idRaw, PARTS[i].dRawLength, PARTS[i].dRawWidth, PARTS[i].dPartHeight)
local vtMove = Vector3d( PARTS[i].RawOffset.dOverMatLeft, PARTS[i].RawOffset.dOverMatOut, 0)
EgtMovePartInRawPart( PARTS[i].id, vtMove)
-- TODO da controllare, se ruotato di 180° bisognerebbe prendere dOverMatIn. Lo stesso per la X
PARTS[i].OffsetPartToRaw = {}
PARTS[i].OffsetPartToRaw.X = PARTS[i].RawOffset.dOverMatLeft
PARTS[i].OffsetPartToRaw.Y = PARTS[i].RawOffset.dOverMatOut
end
end
---------------------------------------------------------------------
-- Crea il grezzo che verrà messo in macchina
---------------------------------------------------------------------
local function CreateRaws( PARTS)
for i = 1, #PARTS do
-- si crea un grezzo "finto" (un cubo da 100mm) nell'origine del pezzo, verrà poi dimensionato uan volta adeguato con i vari sovramateriali
PARTS[i].idRaw = EgtAddRawPart( PARTS[i].frame:getOrigin(), 100, 100, 100, ColA)
EgtAddPartToRawPart( PARTS[i].id, ORIG(), PARTS[i].idRaw)
end
end
---------------------------------------------------------------------
-- Allinea i pezzi in base a come devono essere disposti sulla tavola
---------------------------------------------------------------------
-- TODO in questa fase bisogna già sapere qual è la prima fase e posizionare il pezzo di conseguenza
-- TODO (bassa priorità) adesso allinea sempre in X, ma bisognerebbe farlo in base ad un parametro in WINDATA che dice come si dispongono in macchina
local function AlignRawsToTable( PARTS)
for i = 1, #PARTS do
-- allineo il pezzo all'interno del grezzo
local dRotX, dRotY, dRotZ = GetFixedAxesRotABCFromFrame( PARTS[i].frame)
-- se devo ruotare
if abs( dRotZ) > GEO.EPS_ANG_SMALL then
EgtRotatePartInRawPart( PARTS[i].id, Z_AX(), -dRotZ)
end
-- sposto punto in basso a sinistra del pezzo sul punto in basso a sinistra del grezzo
local b3Part = EgtGetBBoxGlob( PARTS[i].id, GDB_BB.ONLY_VISIBLE)
local dPartPosX = b3Part:getMin():getX()
local dPartPosY = b3Part:getMin():getY()
local dPartPosZ = b3Part:getMin():getZ()
local b3Raw = EgtGetRawPartBBox( PARTS[i].idRaw)
local dRawPosX = b3Raw:getMin():getX()
local dRawPosY = b3Raw:getMin():getY()
local dRawPosZ = b3Raw:getMin():getZ()
local vtMove = Vector3d( dRawPosX - dPartPosX, dRawPosY - dPartPosY, dRawPosZ - dPartPosZ)
EgtMovePartInRawPart( PARTS[i].id, vtMove)
end
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Funzione per trovare nome MachGroup ***
-------------------------------------------------------------------------------------------------------------
local function NewMachGroupName()
local nMachGroupId = EgtGetFirstMachGroup()
if not nMachGroupId then return '1' end
local nMaxMachGroup = 0
while nMachGroupId do
local sMachGroupName = EgtGetMachGroupName( nMachGroupId)
local nMachGroupName = tonumber( sMachGroupName)
if nMachGroupName > nMaxMachGroup then
nMaxMachGroup = nMachGroupName
end
nMachGroupId = EgtGetNextMachGroup( nMachGroupId)
end
return tostring( nMaxMachGroup + 1)
end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento delle travi nel grezzo ***
-------------------------------------------------------------------------------------------------------------
local function MyProcessPieces()
-- creo macchinata
local MachGroupName = NewMachGroupName()
local nMachGroup = EgtAddMachGroup( MachGroupName)
-- si crea il grezzo
CreateRaws( PARTS)
-- allineo i pezzi come orientamento richiesto dalla macchina
AlignRawsToTable( PARTS)
-- aggiungo sovramateriale ai grezzi
AddOverMaterialToRaw( PARTS)
-- recupero offset per posizionamento
for i = 1, #PARTS do
PARTS[i].DispOffsets = {}
PARTS[i].DispOffsets.Phase1 = {}
PARTS[i].DispOffsets.Phase2 = {}
local bInsertedAllOffs = GetDispOffsetFromNotes( i)
-- se non sono settati nelle note, li chiedo
if not bInsertedAllOffs then
bInsertedAllOffs = GetDispOffsetFromInput( i)
end
-- se non sono stati inseriti o c'è stato un errore esco subito
if not bInsertedAllOffs then
return false
end
end
-- si dispongono i pezzi sulla tavola
local bDispOk, sErr = WinData.ExecDisposition( PARTS)
if not bDispOk then
if not sErr then
sErr = 'Errore non gestito in WinData.ExecDisposition'
end
EgtOutBox( sErr, 'ProcessWin', 'ERROR', 'OK')
return false
end
-- Impostazione dell'attrezzaggio di default
local bOk = EgtImportSetup()
if not bOk then
EgtImportSetup( 'Default')
end
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento delle lavorazioni ***
-------------------------------------------------------------------------------------------------------------
local function MyProcessFeatures()
local bOk = WinExec.ProcessFeatures( PARTS)
return true
end
-------------------------------------------------------------------------------------------------------------
-- *** Esecuzione ***
-------------------------------------------------------------------------------------------------------------
-- nascondo geometrie varie
local vAuxId = { EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Profile'), EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Area*'), EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Aux')}
EgtSetStatus( vAuxId, GDB_ST.OFF)
if not MyProcessInputData() then return end
if not MyProcessPieces() then return end
if not GetDataConfig() then return end
-- Abilito Vmill
EgtSetInfo( EgtGetCurrMachGroup(), 'Vm', '1')
if not MyProcessFeatures() then return end
+22
View File
@@ -0,0 +1,22 @@
-- Cutting.lua by Egalware s.r.l. 2024/06/13
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di taglio
-- Tabella per definizione modulo
local Cutting = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
EgtOutLog( ' Cutting started', 1)
EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
function Cutting.Make( Proc, Part)
return true
end
-------------------------------------------------------------------------------------------------------------
return Cutting
+81
View File
@@ -0,0 +1,81 @@
-- Drilling.lua by Egalware s.r.l. 2024/06/13
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di foratura
-- Tabella per definizione modulo
local Drilling = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
local MachiningLib = require( 'MachiningLib')
EgtOutLog( ' Drilling started', 1)
EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
-- funzione che decide se eseguire le forature dopo le profilature. Solo forature di testa inclinate. Altrimenti sempre prima.
local function IsDrillToMachineAfterProfile( Proc)
local bExecAfterProfile = false
if ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and abs( Proc.vtDir:getX()) > 0.15 then
bExecAfterProfile = true
end
return bExecAfterProfile
end
-------------------------------------------------------------------------------------------------------------
function Drilling.Make( Proc, Part)
local Machining = { LeadIn = {}, LeadOut = {}, Steps = {}}
local AuxiliaryData = {}
local ToolSearchParameters = {}
-- cerco utensile punta a forare
ToolSearchParameters.dDiameter = Proc.dDiameter
ToolSearchParameters.dLength = Proc.dLength
local ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
-- se trovato utensile
if ToolInfo.nToolIndex then
Machining.nType = MCH_OY.DRILLING
Machining.nToolIndex = ToolInfo.nToolIndex
Machining.sDepth = 'th'
Machining.Steps.dStep = TOOLS[ToolInfo.nToolIndex].dStep
Machining.Geometry = Proc.id
AuxiliaryData.bExecAfterProfile = IsDrillToMachineAfterProfile( Proc)
AuxiliaryData.bIsDrilling = true
AuxiliaryData.nIndexMachining = 1
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
Machining.dStartSafetyLength = MachiningLib.GetDrillAdditionalSafeDistanceToRaw( Proc, Part, Machining)
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
else
-- provo a cercare una fresa che faccia una svuotatura
ToolSearchParameters.dMaxToolDiameter = Proc.dDiameter
ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
-- se trovato utensile
if ToolInfo.nToolIndex then
Machining.nType = MCH_OY.POCKETING
Machining.nSubType = MCH_POCK_SUB.SPIRALOUT
Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG
Machining.Steps.dStep = TOOLS[ToolInfo.nToolIndex].dStep
Machining.Steps.dSideStep = TOOLS[ToolInfo.nToolIndex].dSideStep
Machining.nToolIndex = ToolInfo.nToolIndex
Machining.LeadIn.dTangentDistance = TOOLS[ToolInfo.nToolIndex].dDiameter/2
Machining.LeadIn.dElevation = TOOLS[ToolInfo.nToolIndex].dDiameter/2
Machining.sDepth = 0
Machining.Geometry = Proc.id
AuxiliaryData.bIsPocketingDrill = true
AuxiliaryData.nIndexMachining = 1
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
else
return false
end
end
return true
end
-------------------------------------------------------------------------------------------------------------
return Drilling
+22
View File
@@ -0,0 +1,22 @@
-- Milling.lua by Egalware s.r.l. 2024/06/13
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di fresatura
-- Tabella per definizione modulo
local Milling = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
EgtOutLog( ' Milling started', 1)
EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
function Milling.Make( Proc, Part)
return true
end
-------------------------------------------------------------------------------------------------------------
return Milling
+22
View File
@@ -0,0 +1,22 @@
-- Pocketing.lua by Egalware s.r.l. 2024/06/13
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di svuotatura
-- Tabella per definizione modulo
local Pocketing = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
EgtOutLog( ' Pocketing started', 1)
EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
function Pocketing.Make( Proc, Part)
return true
end
-------------------------------------------------------------------------------------------------------------
return Pocketing
+109
View File
@@ -0,0 +1,109 @@
-- Profiling.lua by Egalware s.r.l. 2024/06/13
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di profilatura
-- Tabella per definizione modulo
local Profiling = {}
-- Include
require( 'EgtBase')
-- Carico i dati globali
local WinData = require( 'WinData')
local WinLib = require( 'WinLib')
local MachiningLib = require( 'MachiningLib')
EgtOutLog( ' Profiling started', 1)
EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
function Profiling.Make( Proc, Part)
-- se so che utensili utilizzare, associazione diretta
if Proc.nToolsToUse > 0 then
for i = 1, Proc.nToolsToUse do
-- definizione liste
local Machining = { LeadIn = {}, LeadOut = {}, Steps = {}}
local AuxiliaryData = {}
local ToolSearchParameters = {}
-- ricerca utensile
ToolSearchParameters.sName = Proc.Tools[i].sName
ToolSearchParameters.dElevation = 0
local ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
-- se trovato utensile
if ToolInfo.nToolIndex then
Machining.nType = MCH_MY.MILLING
Machining.nWorkside = MCH_MILL_WS.RIGHT
Machining.nToolIndex = ToolInfo.nToolIndex
Machining.sDepth = 0
Machining.dRadialOffset = Proc.Tools[i].dRadialOffset
Machining.dLongitudinalOffset = Proc.Tools[i].dLongitudinalOffset
-- se il pezzo ha cambio-profilo
if Proc.sProfileInfo == 'Mixed' then
Machining.LeadIn.nType = MCH_MILL_LI.LINEAR
Machining.LeadOut.nType = MCH_MILL_LO.LINEAR
Machining.LeadIn.dTangentDistance = 0
Machining.LeadIn.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
Machining.LeadOut.dTangentDistance = 0
Machining.LeadOut.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
else
Machining.LeadIn.nType = MCH_MILL_LI.TANGENT
Machining.LeadOut.nType = MCH_MILL_LO.TANGENT
Machining.LeadIn.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
Machining.LeadIn.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
Machining.LeadOut.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
Machining.LeadOut.dPerpDistance = 0
end
Machining.Geometry = Proc.id
AuxiliaryData.bIsProfiling = true
AuxiliaryData.nIndexMachining = i
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
else
return false, 'Associated tool not found'
end
end
-- altrimenti cerco tra quelli disponibili
else
-- definizione liste
local Machining = { LeadIn = {}, LeadOut = {}, Steps = {}}
local AuxiliaryData = {}
local ToolSearchParameters = {}
-- se profilatura generica, cerco fresa che possa lavorare la geometria considerando spessore e raggio
if Proc.sProfileInfo == 'Generic' then
ToolSearchParameters.dElevation = abs( EgtCurveThickness( Proc.id))
ToolSearchParameters.dMaxToolDiameter = WinLib.GetPathMinRadius( Proc.id) * 2
ToolSearchParameters.sType = 'MILL_STD'
local ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
-- se trovato utensile
if ToolInfo.nToolIndex then
Machining.nType = MCH_MY.MILLING
Machining.nWorkside = MCH_MILL_WS.LEFT
Machining.nToolIndex = ToolInfo.nToolIndex
Machining.sDepth = ToolSearchParameters.dElevation
Machining.dRadialOffset = EgtGetInfo( Proc.id, 'OFFR', 'd') or 0
Machining.dLongitudinalOffset = EgtGetInfo( Proc.id, 'OFFL', 'd') or 0
Machining.LeadIn.nType = MCH_MILL_LI.TANGENT
Machining.LeadOut.nType = MCH_MILL_LO.TANGENT
Machining.LeadIn.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
Machining.LeadIn.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
Machining.LeadOut.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
Machining.LeadOut.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
Machining.Geometry = Proc.id
AuxiliaryData.bIsProfiling = true
AuxiliaryData.nIndexMachining = 1
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
else
return false, 'Tool for generic profiling not found'
end
else
return false, 'Tool for profiling not found'
end
end
return true
end
-------------------------------------------------------------------------------------------------------------
return Profiling
+679
View File
@@ -0,0 +1,679 @@
--
-- EEEEEEEEEE GGGGGG WW WW WW
-- EEEEEEEEEE GGGGGGGGGG WW WW WW
-- EEEE GGGG GGGG WW WW WW
-- EEEE GGGG WWW WWWW WWW
-- EEEEEEE GGGG GGGGGGG WW WWWW WW
-- EEEEEEE GGGG GGGGGGG WWW WWWW WWW
-- EEEE GGGG GGGG WWWW WWWW
-- EEEE GGGG GGGG WWWW WWWW
-- EEEEEEEEEE GGGGGGGGGG WWW WWW
-- EEEEEEEEEE GGGGGG WW WW
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio per librerie
local sBaseDir = EgtGetSourceDir()
EgtOutLog("BaseDir=" .. sBaseDir)
EgtAddToPackagePath( sBaseDir .. '?.lua')
EgtAddToPackagePath( sBaseDir .. 'WinLib\\' .. '?.lua')
_G.package.loaded.WinConst = nil
_G.package.loaded.WinJWDConst = nil
_G.package.loaded.WinCreate = nil
_G.package.loaded.WinCalculate = nil
_G.package.loaded.WinManageProject = nil
_G.package.loaded.JSON = nil
_G.package.loaded.xml2lua = nil
_G.package.loaded.xml2lua_tree = nil
require( 'WinConst')
local WinCreate = require( 'WinCreate')
local WinCalculate = require( 'WinCalculate')
------------------------------------------- PARAMETERS -------------------------------------------
local WindowWidth = 1500
local WindowHeight = 1800
local FrameJointType = WIN_JNT.FULL_H
local SashJointType = WIN_JNT.FULL_V
local vFrameJoints = { FrameJointType, FrameJointType, FrameJointType, FrameJointType}
local vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType}
local dFrameDim = 78
local dSashDim = 78
local vFrameDims = { dFrameDim, dFrameDim, dFrameDim, dFrameDim}
local vSashDims = { dSashDim, dSashDim, dSashDim, dSashDim}
local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\Profilo78.nge'
-- local sProfilePath = 'C:\\EgtData\\EgtWindowMaker\\Profiles\\ProfiloSaomad.nge'
------------------------------------------- ************** -------------------------------------------
EgtNewFile()
EgtStartCounter()
-- importo profilo prescelto
WinCreate.ImportProfile( sProfilePath)
-- creo telaio
local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { WindowWidth, WindowHeight}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, { WindowWidth, WindowHeight, WindowHeight + 800}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, { WindowWidth, WindowHeight + 500, WindowHeight}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.ROUND_ARC, { WindowWidth, WindowHeight}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.SEGMENTAL_ARC, { 1500, 1800, 2200}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER, { WindowWidth, WindowHeight, WindowHeight + 500}, vFrameJoints, { dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim})
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.POINTED_ARC, { 1500, 1500, 2400}, vFrameJoints, { dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim})
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.TRG, { 1500, 1500, 500}, { FrameJointType, FrameJointType, FrameJointType}, { dFrameDim, dFrameDim, dFrameDim})
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.THREE_CENTER_ARC, { 1500, 1500, 1800, 200}, vFrameJoints, { dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim, dFrameDim})
------------------------ Aggiunta split a griglia ------------------------
-- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { 150, 300, 150, 300},
-- { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { 500, 600, 850}, false)
-- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 25}, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 50, 30}, false)
-- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 4, 1, 2, 1},
-- { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 2, 1, 2, 1}, false)
-- WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.ABSOLUTE}, { 2, 1, 200},
-- { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PROPORTIONAL}, { 1, 50, 1})
------------------------ Cambi profilo ------------------------
-- vetro / anta
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- vetro / anta in orizzontale
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120})
-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- anta / vetro
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50})
-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- vetro / anta / vetro
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 90, 120})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- local nSashId = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS)
-- vetro / anta / anta
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims)
-- local nSashId2 = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS)
-- anta battente / anta ricevente / vetro
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 66}, { 90})
-- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- vetro / anta / vetro / anta (1)
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50})
-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50})
-- local vAreas3 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50})
-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS)
-- local nSashId1 = WinCreate.AddSash( vAreas2[2], vSashJoints)
-- local nSashId2 = WinCreate.AddSash( vAreas3[2], vSashJoints)
-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS)
-- vetro / anta / vetro / anta (2)
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, { 90, 120, 90})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- local nSashId1 = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS)
-- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS)
-- vetro / vetro / anta / anta
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25}, { 90, 90, 90})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- local nSashId1 = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS)
-- local nSashId2 = WinCreate.AddSash( vAreas[4], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS)
-- anta / vetro con split
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 90})
-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60})
-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS)
-- anta con split / vetro
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 90})
-- local nSashId = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims)
-- local vAreasSash = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 80})
-- WinCreate.AddFill( vAreasSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreasSash[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- ante ( divise da split orizzontale) / vetro
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 90})
-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 30}, { 95})
-- local nSashId1 = WinCreate.AddSash( vAreas2[1], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId1, WIN_FILLTYPES.GLASS)
-- local nSashId2 = WinCreate.AddSash( vAreas2[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSashId2, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
------------------------ Alzante Scorrevole ------------------------
-- vFrameDims = { 55, 55, 55, 55}
-- vSashDims = { 135, 80, 80, 80}
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { WindowWidth, WindowHeight}, vFrameJoints, vFrameDims)
-- WinCreate.AddThreshold( nFrameId, 'Threshold')
-- anta mobile a sx
-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims},
-- { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED}, { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.FIXED})
-- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSash[1])
-- WinCreate.AddHardware( nSashGrpId, '000592', 'Sx')
-- anta mobile a dx
-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims},
-- { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE}, { WIN_OPENING_TYPES.FIXED, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT})
-- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSash[1])
-- WinCreate.AddHardware( nSashGrpId, '000592', 'Dx')
-- 2 ante mobili, sx davanti
-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims},
-- { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK}, { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT})
-- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSash[1])
-- WinCreate.AddHardware( nSashGrpId, '000593', 'Sx')
-- 2 ante mobili, dx davanti
-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims},
-- { WIN_SASHTYPES.SLIDE_MOVABLE_BACK, WIN_SASHTYPES.SLIDE_MOVABLE}, { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT})
-- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSash[1])
-- WinCreate.AddHardware( nSashGrpId, '000593', 'Dx')
-- 4 ante, le centrali sono mobili
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { 4500, 2100}, vFrameJoints, vFrameDims)
-- -- WinCreate.AddThreshold( nFrameId, 'Threshold')
-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25},
-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED},
-- { WIN_OPENING_TYPES.FIXED, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT, WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.FIXED})
-- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[3], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[4], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSash[1])
-- WinCreate.AddHardware( nSashGrpId, '000594', 'Dx')
-- 4 ante mobili
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { 4500, 2100}, vFrameJoints, vFrameDims)
-- -- WinCreate.AddThreshold( nFrameId, 'Threshold')
-- local vSash = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25},
-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.SLIDE_MOVABLE_BACK, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK},
-- { WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT, WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT, WIN_OPENING_TYPES.COPLANARSLIDE_LEFT})
-- WinCreate.AddFill( vSash[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[3], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSash[4], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSash[1])
-- WinCreate.AddHardware( nSashGrpId, '000595', 'Dx')
------------------------ Finestre vetro fisso ------------------------
-- standard
-- WinCreate.AddBottomRail( nFrameId, 2, { 90, 78})
-- WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
-- divisione orizzontale / verticale
-- WinCreate.AddBottomRail( nFrameId, 2)
-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 70}, { 60})
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 70}, { 60})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- divisione verticale ed orizzontale (1)
-- WinCreate.AddBottomRail( nFrameId, 1, { 60})
-- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 100})
-- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60})
-- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60})
-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas3[2], WIN_FILLTYPES.GLASS)
-- divisione verticale ed orizzontale (2)
-- WinCreate.AddBottomRail( nFrameId, 1)
-- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { WIN_MEASURE.PERCENTAGE}, { 50}, true, { 100, 60, 60})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[4], WIN_FILLTYPES.GLASS)
------------------------ Finestre con anta singola ------------------------
-- standard
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddBottomRail( nSashId, 2, { 90, 60})
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- divisione orizzontale / verticale
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddBottomRail( nSashId, 1, { 100})
-- -- local vAreas = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50})
-- local vAreas = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50})
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
-- divisione verticale e orizzontale
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- local vAreas1 = WinCreate.AddSplits( nSashId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 100})
-- local vAreas2 = WinCreate.AddSplits( vAreas1[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60})
-- local vAreas3 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 60})
-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreas3[2], WIN_FILLTYPES.GLASS)
------------------------ Finestre con più ante singole ------------------------
-- due ante divisione verticale
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- due ante divisione orizzontale
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- tre ante
-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.ABSOLUTE, WIN_MEASURE.ABSOLUTE}, { WindowWidth / 3, WindowWidth / 3}, { 95, 95})
-- -- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 1, 1}, { 95, 95})
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 95, 95})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- tre ante una sopra e due sotto
-- local vAreas1 = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 115})
-- local vAreas2 = WinCreate.AddSplits( vAreas1[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 95})
-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.FIXED)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas2[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- local nSash3Id = WinCreate.AddSash( vAreas2[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT)
-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- sei ante (1)
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 105})
-- local vAreas1 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 95, 95})
-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { 95, 95})
-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas1[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- local nSash3Id = WinCreate.AddSash( vAreas1[3], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- local nSash4Id = WinCreate.AddSash( vAreas2[1], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- local nSash5Id = WinCreate.AddSash( vAreas2[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- local nSash6Id = WinCreate.AddSash( vAreas2[3], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
-- sei ante (2)
-- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { WIN_MEASURE.PERCENTAGE}, { 50}, false, { 120, 100, 85, 100, 85})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- local nSash3Id = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- local nSash4Id = WinCreate.AddSash( vAreas[4], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- local nSash5Id = WinCreate.AddSash( vAreas[5], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- local nSash6Id = WinCreate.AddSash( vAreas[6], vSashJoints, vSashDims)
-- WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
------------------------ Finestre con ante battenti e riceventi ------------------------
-- battente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- battente / ricevente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- battente / battente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33.333, 33.333}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- battente / battente / ricevente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL, WIN_MEASURE.PROPORTIONAL}, { 1, 1, 1, 1},
-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[4], WIN_FILLTYPES.GLASS)
------------------------ Finestre con ante singole e ante battenti/riceventi ------------------------
-- tre ante : singola / ricevente / battente
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 33}, { 115})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local vSashes = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- tre ante ( singola / ricevente/ battente) con split nelle ante
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 33}, { 95})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- local vAreasSash1 = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}, { 60})
-- WinCreate.AddFill( vAreasSash1[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreasSash1[2], WIN_FILLTYPES.GLASS)
-- local vSashes2 = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- local vAreasSash2 = WinCreate.AddSplits( vSashes2[1], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}, { 60})
-- WinCreate.AddFill( vAreasSash2[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreasSash2[2], WIN_FILLTYPES.GLASS)
-- local vAreasSash3 = WinCreate.AddSplits( vSashes2[2], WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.ABSOLUTE}, { WindowHeight * 3 / 5}, { 60})
-- WinCreate.AddFill( vAreasSash3[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vAreasSash3[2], WIN_FILLTYPES.GLASS)
-- 3 ante : sopra battente / ricevente, sotto singola
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 70}, { 105})
-- local nSash0Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.FIXED)
-- WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS)
-- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- 4 ante : sopra anta singola e sotto singola ( con split) / battente / ricevente
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 30}, { 95})
-- local vAreas1 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 30}, { 95})
-- local nSash0Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP)
-- WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS)
-- local nSash1Id = WinCreate.AddSash( vAreas1[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- local vSashAreas = WinCreate.AddSplits( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 60}, { 60})
-- WinCreate.AddFill( vSashAreas[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashAreas[2], WIN_FILLTYPES.GLASS)
-- local vSashes = WinCreate.AddSashGroup( vAreas1[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- sei ante : divisione orizzontale e per ogni divisione anta singola / battente/ ricevente
-- local vAreas = WinCreate.AddGridSplits( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 33}, { WIN_MEASURE.PERCENTAGE}, { 50}, false, { 115, 95, 95})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims,WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- local nSash2Id = WinCreate.AddSash( vAreas[3], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- local vSashes1 = WinCreate.AddSashGroup( vAreas[2], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes1[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes1[2], WIN_FILLTYPES.GLASS)
-- local vSashes2 = WinCreate.AddSashGroup( vAreas[4], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes2[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes2[2], WIN_FILLTYPES.GLASS)
------------------------ Ferramenta ------------------------
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.RECT, { 1500, 2100}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.ROUND_ARC, { 1500, 2100}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.SEGMENTAL_ARC, { 1500, 1500, 1700}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER_SIDE, { 1500, 1800 + 1200, 1800}, vFrameJoints, vFrameDims)
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPES.CHAMFER, { 1500, 1500, 1800}, vFrameJoints, vFrameDims)
-- anta singola
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- WinCreate.AddHardware( nSashId, '000558', 'Sx')
-- -- WinCreate.AddHardware( nSashId, '000545', 'Sx') -- aria 4, errato ma crea alcune lavorazioni in più
-- -- WinCreate.AddHardware( nSashId, '000596', 'Sx') -- arco a tutto sesto
-- -- WinCreate.AddHardware( nSashId, '000597', 'Sx') -- arco ribassato
-- -- WinCreate.AddHardware( nSashId, '000604', 'Sx') -- trapezio
-- 2 ante singole
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 95})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_RIGHT)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- WinCreate.AddHardware( nSash1Id, '000558', 'Sx')
-- WinCreate.AddHardware( nSash2Id, '000558', 'Dx')
-- -- WinCreate.AddHardware( nSash1Id, '000610', 'Sx') -- arco a tutto sesto
-- -- WinCreate.AddHardware( nSash2Id, '000610', 'Dx')
-- -- WinCreate.AddHardware( nSash1Id, '000611', 'Sx') -- arco ribassato
-- -- WinCreate.AddHardware( nSash2Id, '000611', 'Dx')
-- -- WinCreate.AddHardware( nSash1Id, '000604', 'Sx') -- trapezio
-- -- WinCreate.AddHardware( nSash2Id, '000604', 'Dx')
-- 2 ante singole con apertura sul montante
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, { WIN_MEASURE.PERCENTAGE}, { 50}, { 120})
-- local nSash1Id = WinCreate.AddSash( vAreas[1], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- local nSash2Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- WinCreate.AddHardware( nSash1Id, '000558', 'Sx')
-- WinCreate.AddHardware( nSash2Id, '000558', 'Sx')
-- 3 ante : sotto singola, sopra battente / ricevente
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, { WIN_MEASURE.PERCENTAGE}, { 60}, { 95})
-- local nSash1Id = WinCreate.AddSash( vAreas[2], vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTTURN_LEFT)
-- WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- WinCreate.AddHardware( nSash1Id, '000558', 'Sx')
-- local vSashes = WinCreate.AddSashGroup( vAreas[1], { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000559', 'Sx')
-- 2 ante : battente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000559', 'Sx')
-- -- WinCreate.AddHardware( nSashGrpId, '000598', 'Sx') -- arco tutto sesto
-- -- WinCreate.AddHardware( nSashGrpId, '000599', 'Sx') -- arco ribassato
-- 2 ante : ricevente / battente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE}, { 50}, { vSashJoints, vSashJoints}, { vSashDims, vSashDims}, { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000559', 'Dx')
-- 3 ante : battente / battente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000564', 'Sx')
-- 3 ante : ricevente / battente / battente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.ACTIVE_OUT},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000564', 'Dx')
-- 3 ante : battente / ricevente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000565', 'Sx')
-- 3 ante : ricevente / ricevente / battente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 33, 33}, { vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.INACTIVE_OUT, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.ACTIVE},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000565', 'Dx')
-- 4 ante : battente / battente / ricevente / ricevente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25},
-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[4], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000575', 'Sx')
-- 4 ante : ricevente / ricevente / battente / battente
-- local vSashes = WinCreate.AddSashGroup( nFrameId, { WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE, WIN_MEASURE.PERCENTAGE}, { 25, 25, 25},
-- { vSashJoints, vSashJoints, vSashJoints, vSashJoints}, { vSashDims, vSashDims, vSashDims, vSashDims},
-- { WIN_SASHTYPES.INACTIVE_OUT, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.ACTIVE_OUT},
-- { WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_LEFT, WIN_OPENING_TYPES.TURNONLY_RIGHT, WIN_OPENING_TYPES.TURNONLY_RIGHT})
-- WinCreate.AddFill( vSashes[1], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[2], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[3], WIN_FILLTYPES.GLASS)
-- WinCreate.AddFill( vSashes[4], WIN_FILLTYPES.GLASS)
-- local nSashGrpId = EgtGetParent( vSashes[1])
-- WinCreate.AddHardware( nSashGrpId, '000575', 'Dx')
-- vasistas
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints, vSashDims, WIN_OPENING_TYPES.TILTONLY_TOP)
-- WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- WinCreate.AddHardware( nSashId, '000573', 'Sx')
-----------------------------------------------------------------------------------
-- imposto se calcolare solidi/preview o meno
WinCalculate.SetCalcSolid( true)
WinCalculate.SetCalcPreview( true)
-- creo i pezzi
WinCalculate.CreatePartFromArea( nFrameId)
-- WinCalculate.AddHardware( nFrameId, true, false, false, false)
-- WinCalculate.AddAccessories( nFrameId, true)
-- tronchetti
-- local nLogsNbr = 7
-- local vSections = { 100, 150, 80, 130, 120, 180}
-- local nLogsNbr = 0 -- numero minimo
-- local vSections = { 120}
-- local bAlign = false
-- local dOverMatOut = 10
-- local dOverMatIn = 7
-- local dOverMatExt = 5
-- local dOverMatInt = 3
-- local bCutExtremities = true
-- -- cerco i pezzi ad arco
-- local vParts = EgtGetAllInGroup( 0)
-- for i = 1, #vParts do
-- local nOutline = EgtGetInfo( vParts[i], WIN_REF_OUTLINE, 'i') or GDB_ID.NULL
-- if EgtGetType( nOutline) == GDB_TY.CRV_ARC then
-- -- se anta richiedo allineamento con telaio
-- local nAreaId = EgtGetParent( EgtGetParent( nOutline))
-- local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
-- if nAreaType == WIN_AREATYPES.SASH then
-- bAlign = true
-- nLogsNbr = 0
-- end
-- WinCalculate.CreateArcLogs( vParts[i], nLogsNbr, vSections, bAlign, dOverMatOut, dOverMatIn, dOverMatExt, dOverMatInt, bCutExtremities)
-- end
-- end
EgtZoom( SCE_ZM.ALL)
-- riporto tempi di esecuzione
local sOut = string.format( ' ExecTime = %.2f ms', EgtStopCounter())
EgtOutLog( sOut)
+473
View File
@@ -0,0 +1,473 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinConst = {}
------------------------------------------- PARAMETERS -------------------------------------------
-- tipi di telaio
WIN_FRAME_TYPES = {
RECT = 1,
CHAMFER_SIDE = 2,
CHAMFER = 3,
ROUND_ARC = 4,
SEGMENTAL_ARC = 5,
POINTED_ARC = 6,
TRG = 7,
THREE_CENTER_ARC = 8,
}
-- forme per anta
WIN_SASH_SHAPE = 'SashShape'
WIN_SASH_SHAPES = {
RECT = 'Rectangle',
TRAP = 'Trapezoid',
ROUND_ARC = 'FullArc',
SEGMENTAL_ARC = 'Arc',
SEMI_ROUND_ARC = 'SemiFullArc',
SEMI_SEGMENTAL_ARC = 'SemiArc',
CIRCLE = 'Circle',
GENERIC = 'Custom',
}
-- direzioni di split
WIN_SPLIT_DIR = 'SplitOrientation'
WIN_SPLITORIENTATION = {
VERTICAL = 1,
HORIZONTAL = 2,
}
-- tipi di misure
WIN_MEASURE_TYPE = 'MeasureType'
WIN_MEASURE = {
ABSOLUTE = 1,
PROPORTIONAL = 2,
PERCENTAGE = 3,
}
-- tipologia di figli
WIN_CHILDREN_TYPES = {
NULL = 0,
SASH = 1,
FILL = 2,
MIXED = 3,
}
WIN_THRESHOLD_TYPES = {
NULL = 0,
ALU = 1, -- soglia
WOOD = 2, -- legno
WOOD_ALU = 3, -- gocciolatoio in alluminio
}
WIN_SURF_APPROX = 0.05
-- AREE
WIN_AREA = 'Area'
WIN_AREA_NAME = 'AreaName'
WIN_FRAME = 'Frame'
WIN_SASH = 'Sash'
WIN_FILL = 'Fill'
WIN_SPLIT = 'Split'
WIN_FRAME_TYPE = 'FrameType'
-- tipo di Area
WIN_AREATYPE = 'AreaType'
WIN_AREATYPES = {
NULL = 0,
FRAME = 1,
SASH = 2,
FILL = 3,
SPLIT = 4,
}
-- tipi di split
WIN_SPLITTYPE = 'SplitType'
WIN_SPLITTYPES = {
NULL = 0,
MULLION = 1, -- montante nel telaio che separa due ante
FRENCH = 2, -- per ante battente / ricevente
MIXED = 3, -- cambio profilo
INSASH = 4, -- divisione nell'anta
INFRAME = 5, -- divisione nel telaio che separa due vetri fissi
}
-- tipi di riempimento interno
WIN_FILLTYPE = 'FillType'
WIN_FILLTYPES = {
NULL = 0,
GLASS = 1,
WOOD = 2,
}
WIN_GLASS = 'GLASS'
WIN_WOOD = 'WOOD'
-- tipi di anta
WIN_SASHTYPE = 'SashType'
WIN_SASHTYPES = {
NULL = 0,
ACTIVE = 1, -- battente
INACTIVE = 2, -- ricevente
ACTIVE_IN = 3, -- battente contro ricevente ( nel caso di più ante battenti)
ACTIVE_OUT = 4, -- battente contro battente ( nel caso di più ante battenti)
INACTIVE_IN = 5, -- ricevente contro battente ( nel caso di più ante riceventi)
INACTIVE_OUT = 6, -- ricevente contro ricevente ( nel caso di più ante riceventi)
SLIDE_MOVABLE = 7, -- mobile in alzante scorrevole
SLIDE_FIXED = 8, -- fissa in alzante scorrevole
SLIDE_MOVABLE_BACK = 9, -- mobile più esterna in alzante scorrevole con tutte ante mobili
}
WIN_INACTIVE = 'INACTIVE'
-- tipi di apertura ante
WIN_OPENING_TYPE = 'OpeningType'
WIN_OPENING_TYPES = {
NULL = 0,
TURNONLY_LEFT = 1,
TURNONLY_RIGHT = 2,
TILTTURN_LEFT = 3,
TILTTURN_RIGHT = 4,
TILTONLY_TOP = 5,
TILTONLY_BOTTOM = 6,
PIVOT = 7,
FIXED = 8,
COPLANARSLIDE_LEFT = 9,
COPLANARSLIDE_RIGHT = 10,
LIFTSLIDE_LEFT = 11,
LIFTSLIDE_RIGHT = 12,
}
-- tipi di pezzo
WIN_PART_TYPE = 'PART_TYPE'
WIN_PART_TYPES = {
NULL = 0,
FILL = 1,
BOTTOMRAIL = 2,
STD = 3,
}
WIN_AREAOUTLINE = 'BaseOutline'
WIN_OUTLINE = 'Outline'
WIN_BASESPLIT = 'BaseSplit'
WIN_SELECTION = 'Selection'
WIN_SPLITSELECTION = 'SplitSelection'
WIN_SASH_OPENING = 'Opening'
WIN_AUX = 'Aux'
WIN_PREVIEW = 'Preview'
WIN_VIRTUAL_AREA = 'VirtualArea'
WIN_BOTTOM = 'Bottom'
WIN_BOTTOMRAIL = 'BottomRail'
WIN_RIGHT = 'Right'
WIN_TOP = 'Top'
WIN_LEFT = 'Left'
-- info varie su aree e curve
WIN_PART_DIM = 'PartDim'
WIN_SOU = 'SOU'
WIN_CHILD = 'CHILD'
WIN_COPY = 'COPY'
WIN_REF_OUTLINE = 'OutlineRef'
WIN_REF_PART = 'PartRef'
WIN_REF_BOTTOMRAIL_PART = 'BottomRailPartRef'
WIN_PREV_OUTLINES = 'PrevOutlines'
WIN_NEXT_OUTLINES = 'NextOutlines'
WIN_REF_SPLIT = 'RefSplit'
WIN_INV_SPLIT = 'InvSplit'
WIN_CRV_ON_FRENCH_SPLIT = 'OutlineOnFrenchSplit'
WIN_SPLIT_STARTINTERS = 'SplitStartInters'
WIN_SPLIT_ENDINTERS = 'SplitEndInters'
WIN_SASH_CHILDREN = 'SashChildren'
WIN_FILL_CHILDREN = 'FillChildren'
WIN_THRESHOLD_PROFILE = 'ThresholdProfile'
WIN_SLIDE_WINDOW = 'SlideWindow'
WIN_SASH_NBR = 'SashNbr'
WIN_AREA_NBR = 'AreaNbr'
WIN_AREA_PROFILES = 'AreaProfiles'
WIN_MEASURE_VALUE = 'MeasureValue'
WIN_GRIDSPLIT_ORDER = 'GridSplitOrder'
WIN_SPLIT_POSITION = 'SplitPosition'
WIN_SPLIT_REF_DIM = 'SplitRefDim'
WIN_SPLIT_OFFS = 'SplitOffs'
WIN_GRID_SPLIT = 'GridSplit'
-- PROFILI
WIN_PROFILE = 'Profile'
WIN_PROFILEPATH = 'ProfilePath'
WIN_INFO_GRP = 'Info'
-- nomi dei profili
WIN_SASH_TOP = 'Sash_Top'
WIN_SASH_BOTTOM = 'Sash_Bottom'
WIN_FIXED = 'Fixed'
WIN_FIXED_TOP = 'Fixed_Top'
WIN_FIXED_BOTTOM = 'Fixed_Bottom'
WIN_RAIL_BOTTOM = 'Rail_Bottom'
WIN_RAIL = 'Rail'
WIN_FILL_RAIL = 'Fill_Rail'
WIN_FRAME_SPLIT = 'Frame_Split'
WIN_SASH_VERTICAL = 'Sash_Vertical'
WIN_SASH_HORIZONTAL = 'Sash_Horizontal'
WIN_MIXED = 'Mixed'
WIN_MIXED_BOTTOM = 'Mixed_Bottom'
WIN_MIXED_TOP = 'Mixed_Top'
WIN_MIXED_SPLIT = 'Mixed_Split'
WIN_SASH_THRESHOLD = 'Sash_Threshold'
WIN_FRAME_TOP = 'Frame_Top'
WIN_FRAME_BOTTOM = 'Frame_Bottom'
WIN_SASH_ACTIVE = 'Sash_Active'
WIN_SASH_INACTIVE = 'Sash_Inactive'
WIN_FRENCH_IN = 'French_In'
WIN_FRENCH_OUT = 'French_Out'
WIN_SASH_SPLIT = 'Sash_Split'
WIN_SLIDE = 'Slide'
WIN_MOVABLE = 'Movable'
WIN_SLIDE_MOVABLEBACK = 'Slide_MovableBack'
WIN_SLIDE_TOP = 'Slide_Top'
WIN_SLIDE_BOTTOM = 'Slide_Bottom'
WIN_SLIDE_MOVABLE = 'Slide_Movable'
WIN_SLIDE_FIXED = 'Slide_Fixed'
WIN_SLIDE_MOVABLE_TOP = 'Slide_Movable_Top'
WIN_SLIDE_MOVABLE_BOTTOM = 'Slide_Movable_Bottom'
WIN_SLIDE_MOVABLE_SIDE = 'Slide_Movable_Side'
WIN_SLIDE_MOVABLEBACK_TOP = 'Slide_MovableBack_Top'
WIN_SLIDE_MOVABLEBACK_BOTTOM = 'Slide_MovableBack_Bottom'
WIN_SLIDE_MOVABLEBACK_SIDE = 'Slide_MovableBack_Side'
WIN_SLIDE_FIXED_BOTTOM = 'Slide_Fixed_Bottom'
WIN_SLIDE_FIXED_TOP = 'Slide_Fixed_Top'
WIN_SLIDE_FIXED_SIDE = 'Slide_Fixed_Side'
WIN_SLIDE_ACTIVE = 'Slide_Active'
WIN_SLIDE_ACTIVE_IN = 'Slide_Active_In'
WIN_SLIDE_INACTIVE = 'Slide_Inactive'
-- elementi dei profili
WIN_REF = 'Ref'
WIN_SECTIONFRAME = 'SectionFrame'
WIN_SECTION = 'Section'
WIN_IN = 'In'
WIN_CTRIN = 'CtrIn'
WIN_OUT = 'Out'
WIN_OFST = 'Ofst'
WIN_CTRINOFST = 'OfstCtrIn'
WIN_OUTOFST = 'OfstOut'
WIN_MIXED_COMMON = 'Common'
WIN_SIMPLIFIED = 'Simplified'
WIN_STRIP = 'Strip'
WIN_WATERDRIP = 'Waterdrip'
WIN_GASKET = 'Gasket'
WIN_THRESHOLD = 'Threshold'
-- info sui profili
WIN_DIM_STD = 'DimStd'
WIN_DIM_MIN = 'DimMin'
WIN_DIM_MAX = 'DimMax'
WIN_OVERLAP = 'Overlap'
WIN_SASH_TOP_OVERLAP = 'SashTopOverlap'
WIN_SASH_BOTTOM_OVERLAP = 'SashBottomOverlap'
WIN_DELTA = 'Delta'
WIN_FILLOVERLAP = 'FillOverlap'
WIN_FILLDELTA = 'FillDelta'
WIN_GLASSTHICKNESS = 'GlassThickness'
WIN_RAILOFFS = 'RailOffs'
-- per ferramenta
WIN_GAPDELTA = 'GapDelta'
WIN_GAPDELTAZ = 'GapDeltaZ'
-- per accessori
WIN_STRIP_DIST = 'StripDistance'
WIN_TRIM = 'Trim'
-- per cambio profilo
WIN_FIXED_REF = 'FixedRef'
WIN_SASH_REF = 'SashRef'
WIN_SASH_DEPTH = 'SashDepth'
WIN_RAD_REF = 'RefRad'
WIN_EXTRA_DIST = 'ExtraDist'
-- per lavorazioni
WIN_PRC_OVERMAT_IN = 'OVERMAT_IN'
WIN_PRC_OVERMAT_OUT = 'OVERMAT_OUT'
WIN_PRC_OVERMAT_LEFT = 'OVERMAT_LEFT'
WIN_PRC_OVERMAT_RIGHT = 'OVERMAT_RIGHT'
WIN_PRC_PHASE = 'PHASE'
WIN_PRC_NTOOLS = 'NTOOLS'
WIN_PRC_TOOL_NAME = 'TOOL_NAME'
WIN_PRC_OFFL = 'OFFL'
WIN_PRC_OFFR = 'OFFR'
WIN_PRC_OFFY_1 = 'OFFY_1'
WIN_PRC_OFFZ_1 = 'OFFZ_1'
WIN_PRC_OFFY_2 = 'OFFY_2'
WIN_PRC_OFFZ_2 = 'OFFZ_2'
WIN_PRC_CLAMPV_1 = 'CLAMPV_1'
WIN_PRC_CLAMPV_2 = 'CLAMPV_2'
WIN_PRC_ID = 'ID'
-- codici
WIN_PROFILE_CODES = {
SASH = 1,
FIXED_GLASS = 2,
MIXED = 4,
FRAME_RAIL = 8,
SASH_RAIL = 16,
SLIDE = 32,
}
-- Profili pezzo
WIN_PRF_MAIN = 'Main'
WIN_PRF_START = 'Start'
WIN_PRF_END = 'End'
WIN_PRF_SPLIT = 'Split'
WIN_PROFILETYPE = 'ProfileType'
-- GIUNZIONI
WIN_JOINTS = 'Joints'
WIN_JOINT_BL = 'JointBL'
WIN_JOINT_BR = 'JointBR'
WIN_JOINT_TL = 'JointTL'
WIN_JOINT_TR = 'JointTR'
WIN_STARTJOINT = 'StartJoint'
WIN_ENDJOINT = 'EndJoint'
-- tipi di giunzioni
WIN_JNT = {
ANGLED = 1,
FULL_H = 2,
FULL_V = 3,
}
-- tipi di giunzione pezzo
WIN_PART_JNT = {
ANGLED = 1,
FULL = 2,
SHORT = 3,
}
-- GEO
WIN_GEO = 'Geo'
WIN_GEO_RAW = 'GeoRaw'
WIN_GEO_IN = 'In'
WIN_GEO_OUT = 'Out'
WIN_GEO_LEFT = 'Left'
WIN_GEO_RIGHT = 'Right'
WIN_PRC_FRAME = 'AuxFrame'
WIN_GEOWIDTH = 'GeoWidth'
WIN_GEOHEIGHT = 'GeoHeight'
WIN_GEOLEN = 'GeoLen'
WIN_SEMI_PROFILE = 'SemiProfileId'
WIN_GLASS_RECT = 'GlassRectangle'
WIN_GEO_SURF = 'GeoRegion'
WIN_GEO_EXTRA = 'GeoExtra'
WIN_REF_GEO = 'GeoRef'
WIN_GEO_OFFS = 'GeoOffs'
WIN_TANG_START = 'ExtendTangStart'
WIN_TANG_END = 'ExtendTangEnd'
WIN_REF_SURF = 'SurfRef'
WIN_REF_PRC = 'PrcRef'
-- CAMBIO PROFILO
WIN_PRF_CHANGE = 'ProfileChange'
WIN_MIXED_CURVES = 'ProfileChangeCurves'
WIN_MIXED_MILLING = 'ProfileChangeMilling'
WIN_MIXED_SPLIT_REF = 'MixedSplitRef'
WIN_MIXED_SASHFILL = 'MixedSashFill'
-- SOLIDI
WIN_SOLID = 'Solid'
WIN_MAINGUIDE = 'MainGuide'
WIN_SRF_MAIN = 'MainSurface'
WIN_SRF_ORIGMAIN = 'OrigMainSurface'
WIN_SRF_STRIP = 'StripSurface'
-- LAVORAZIONI
WIN_PRC = 'Processings'
WIN_PRC_FEATURE_TYPE = 'FEATURE_TYPE'
WIN_PRC_TYPE = {
HOLE = 'Hole',
PROFILING = 'Profiling',
POCKET = 'Pocket',
CUT = 'Cut',
STRIP_CUT = 'StripCut'
}
WIN_PRC_PROFILE_INFO = 'PROFILE_INFO'
WIN_PRC_PROFILE_TYPE = {
HEAD = 'Head',
LONGITUDINAL = 'Longitudinal',
MIXED = 'Mixed',
GENERIC = 'Generic'
}
WIN_PRC_SIDE = 'REFERENCE_SIDE'
WIN_PRC_SIDETYPE = {
OUT = 'Out',
IN = 'In',
LEFT = 'Left',
RIGHT = 'Right'
}
WIN_PRC_PROFILE_IN = 'PROFILE_IN'
WIN_PRC_PROFILE_OUT = 'PROFILE_OUT'
WIN_PRC_PROFILE_LEFT = 'PROFILE_LEFT'
WIN_PRC_PROFILE_RIGHT = 'PROFILE_RIGHT'
-- SPINE
WIN_DOWEL = 'Dowel'
WIN_DWL_DIAM = 'DowelsDiam'
WIN_DWL_TOP_PERP_LEN = 'TopPerpLen'
WIN_DWL_TOP_PARA_LEN = 'TopParaLen'
WIN_DWL_INACTIVE_PERP_LEN = 'InactivePerpLen'
WIN_DWL_INACTIVE_PARA_LEN = 'InactiveParaLen'
WIN_DWL_BOTTOM_PERP_LEN = 'BottomPerpLen'
WIN_DWL_BOTTOM_PARA_LEN = 'BottomParaLen'
WIN_DWL_RAILBOTTOM_PERP_LEN = 'RailBottomPerpLen'
WIN_DWL_RAILBOTTOM_PARA_LEN = 'RailBottomParaLen'
WIN_DWL_SPLIT_PERP_LEN = 'SplitPerpLen'
WIN_DWL_SPLIT_PARA_LEN = 'SplitParaLen'
WIN_DWL_LOG_LEN = 'DowelsLogLen'
-- TRONCHETTI
WIN_LOGS = 'Log'
-- ACCESSORI
WIN_GASKET_LEN = 'GasketLen'
WIN_WATERDRIP = 'Waterdrip'
WIN_WATERDRIP_LEN = 'WaterdripLen'
WIN_THRESHOLD_LEN = 'ThresholdLen'
-- FERRAMENTA
WIN_HDW_FAVOURITE = 'HdwFavourite'
WIN_HDW_NULL = '000000'
WIN_HDW_HANDLE = 'HdwHandle'
WIN_HDW_FRAME = 'HdwFrame'
WIN_HDW_HANDLE_HEIGHT = 'HMan'
WIN_HDW_OPTIONS = 'HdwOptions'
WIN_HDW_HINGES = 'HdwHinges'
-- Return mode
WIN_HDW_RETURNMODE = {
HARDWARELIST = 1,
POSITIONLIST = 2,
MACHININGLIST = 4,
OPTIONLIST = 8
}
---------------------------------------------------------------------
return WinConst
+58
View File
@@ -0,0 +1,58 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinJWDConst = {}
------------------------------------------- PARAMETERS -------------------------------------------
JWD_PROFILE_PATH = 'ProfilePath'
JWD_AREA_LIST = 'AreaList'
JWD_AREA_TYPE = 'AreaType'
JWD_JOINTS = 'JointList'
JWD_JOINT_TYPE = 'JointType'
JWD_BOTTOMRAIL = 'BottomRail'
JWD_BOTTOMRAIL_QTY = 'BottomRailQty'
JWD_BR_ELEMENT_DIMENSION = 'BottomRailElemDimList'
JWD_INDEX = 'Index'
JWD_DIMENSION = 'Dimension'
JWD_NAME = 'Name'
JWD_VALUE = 'Value'
JWD_ID_GROUP = 'GroupId'
JWD_ID_SASH = 'SashId'
JWD_MEASURE_TYPE = 'MeasureType'
JWD_ELEMENT_DIMENSION = 'ElementDimensionList'
JWD_FRAME_SHAPE = 'Shape'
JWD_DIMENSION_LIST = 'DimensionList'
JWD_THRESHOLD = 'Threshold'
JWD_SASH_LIST = 'SashList'
JWD_HAS_HANDLE = 'HasHandle'
JWD_OPENING_TYPE = 'OpeningType'
JWD_HARDWARE = 'Hardware'
JWD_HARDWARE_OPTIONS = 'HwOptionList'
JWD_SPLIT_TYPE = 'SplitShape'
JWD_SPLIT_START_VERT = 'SplitStartVert'
JWD_SPLIT_VERT_POS = 'SplitVertList'
JWD_SPLIT_HORIZ_POS = 'SplitHorizList'
JWD_SPLIT_AREA = 'Area'
JWD_ELEMENT_VERT_DIMENSION = 'ElementDimVertList'
JWD_ELEMENT_HORIZ_DIMENSION = 'ElementDimHorizList'
JWD_FILL_TYPE = 'FillType'
---------------------------------------------------------------------
return WinJWDConst
File diff suppressed because it is too large Load Diff
+763
View File
@@ -0,0 +1,763 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinCreate = {}
-- funzioni
----------------------------------------------------------------------------------
local function AddInfo( nId, sInfo, nVal)
local vInfo = EgtGetInfo( nId, sInfo, 'vi') or {}
table.insert( vInfo, nVal)
EgtSetInfo( nId, sInfo, vInfo)
end
----------------------------------------------------------------------------------
local function CopyParentOutline( nAreaId, nParentAreaId)
-- recupero outline del parent
local nParentOutlineLayerId = EgtGetFirstNameInGroup( nParentAreaId, WIN_AREAOUTLINE)
local vParentCrvs = EgtGetAllInGroup( nParentOutlineLayerId)
-- creo outline per area corrente
local nOutlineLayerId = EgtGroup( nAreaId)
EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE)
-- copio le curve di outline del parent e setto le corrispondenze sou/child
for i = 1, #vParentCrvs do
local nOutlineId = EgtCopy( vParentCrvs[i], nOutlineLayerId)
EgtSetInfo( nOutlineId, WIN_SOU, vParentCrvs[i])
EgtSetInfo( vParentCrvs[i], WIN_CHILD, nOutlineId)
end
return nOutlineLayerId
end
----------------------------------------------------------------------------------
------------------------------------ PROFILO -------------------------------------
----------------------------------------------------------------------------------
-- funzione che importa il profilo
function WinCreate.ImportProfile( sProfilePath)
-- verifico esistenza file
if not EgtExistsFile( sProfilePath) then
EgtOutLog( 'File del profilo non trovato! ' .. sProfilePath)
EgtOutText( 'File del profilo non trovato! ' .. sProfilePath)
EgtPause(5000)
return false
end
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, WIN_PROFILE)
EgtSetLevel( nProfileId, GDB_LV.SYSTEM)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
-- recupero gruppi importati e li sposto nel gruppo profilo
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- riporto path nel Part del profilo
EgtSetInfo( nProfileId, WIN_PROFILEPATH, sProfilePath)
return true
end
----------------------------------------------------------------------------------
------------------------------------- TELAIO -------------------------------------
----------------------------------------------------------------------------------
-- funzione che crea le curve che definiscono il telaio in base alla geometria richiesta
local function CreateFrameCurves( nLayerId, nType, vDim)
-- rettangolo
if nType == WIN_FRAME_TYPES.RECT then
-- vDim[1] larghezza, vDim[2] altezza dei lati verticali
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[2], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTopId = EgtLine( nLayerId, Point3d( vDim[1], vDim[2], 0), Point3d( 0, vDim[2], 0))
EgtSetName( nTopId, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
-- lato top inclinato
elseif nType == WIN_FRAME_TYPES.CHAMFER_SIDE then
-- vDim[1] larghezza, vDim[2] altezza del lato sx, vDim[3] altezza del lato dx
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[3], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTopId = EgtLine( nLayerId, Point3d( vDim[1], vDim[3], 0), Point3d( 0, vDim[2], 0))
EgtSetName( nTopId, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
-- triangular arch
elseif nType == WIN_FRAME_TYPES.CHAMFER then
-- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[2], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTop1Id = EgtLine( nLayerId, Point3d( vDim[1], vDim[2], 0), Point3d( vDim[1] / 2, vDim[3], 0))
local nTop2Id = EgtLine( nLayerId, Point3d( vDim[1] / 2, vDim[3], 0), Point3d( 0, vDim[2], 0))
EgtSetName( nTop1Id, WIN_TOP)
EgtSetName( nTop2Id, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
-- arco a tutto sesto
elseif nType == WIN_FRAME_TYPES.ROUND_ARC then
-- vDim[1] larghezza, vDim[2] altezza complessiva
-- verifico che altezza sia sensata
if vDim[2] < 0.5 * vDim[1] + GEO.EPS_SMALL then
return false
end
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[2] - 0.5 * vDim[1], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTopId = EgtArcCPA( nLayerId, Point3d( 0.5 * vDim[1], vDim[2] - 0.5 * vDim[1], 0), Point3d( vDim[1], vDim[2] - 0.5 * vDim[1], 0), 180, 0)
EgtSetName( nTopId, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2] - 0.5 * vDim[1], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
-- arco ribassato
elseif nType == WIN_FRAME_TYPES.SEGMENTAL_ARC then
-- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva
-- controllo che non degeneri in arco a tutto sesto
if vDim[3] - vDim[2] > 0.5 * vDim[1] - GEO.EPS_SMALL then
return false
end
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[2], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTopId = EgtArc3P( nLayerId, Point3d( vDim[1], vDim[2], 0), Point3d( 0.5 * vDim[1], vDim[3], 0), Point3d( 0, vDim[2], 0))
EgtSetName( nTopId, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
-- arco a 3 centri
elseif nType == WIN_FRAME_TYPES.THREE_CENTER_ARC then
-- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva, vDim[4] raggio di raccordo
-- controllo sulle dimensioni
if vDim[3] - vDim[2] > 0.5 * vDim[1] - GEO.EPS_SMALL or vDim[4] > 0.5 * vDim[1] - GEO.EPS_SMALL then
return false
end
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[2], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTopId = EgtArc3P( nLayerId, Point3d( vDim[1], vDim[2], 0), Point3d( 0.5 * vDim[1], vDim[3], 0), Point3d( 0, vDim[2], 0))
EgtSetName( nTopId, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
local nFillet1 = EgtCurveFillet( nLayerId, nRightId, EgtUP( nRightId, 0.9), nTopId, EgtUP( nTopId, 0.1), vDim[4], true)
EgtRelocateGlob( nFillet1, nTopId, GDB_IN.BEFORE)
EgtSetName( nFillet1, WIN_TOP)
local nFillet2 = EgtCurveFillet( nLayerId, nTopId, EgtUP( nTopId, 0.9), nLeftId, EgtUP( nLeftId, 0.1), vDim[4], true)
EgtRelocateGlob( nFillet2, nTopId, GDB_IN.AFTER)
EgtSetName( nFillet2, WIN_TOP)
-- arco a sesto acuto
elseif nType == WIN_FRAME_TYPES.POINTED_ARC then
-- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva
-- verifico che le due altezze abbiano valori sensati per realizzare i due archi
if vDim[3] - vDim[2] < 0.5 * vDim[1] then
return false
end
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nRightId = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[1], vDim[2], 0))
EgtSetName( nRightId, WIN_RIGHT)
local nTop1Id = EgtArc2PV( nLayerId, Point3d( vDim[1], vDim[2], 0), Point3d( 0.5 * vDim[1], vDim[3], 0), Y_AX())
EgtSetName( nTop1Id, WIN_TOP)
local nTop2Id = EgtArc2PV( nLayerId, Point3d( 0, vDim[2], 0), Point3d( 0.5 * vDim[1], vDim[3], 0), Y_AX())
EgtInvertCurve( nTop2Id)
EgtSetName( nTop2Id, WIN_TOP)
local nLeftId = EgtLine( nLayerId, Point3d( 0, vDim[2], 0), ORIG())
EgtSetName( nLeftId, WIN_LEFT)
-- triangolo
elseif nType == WIN_FRAME_TYPES.TRG then
-- vDim[1] larghezza, vDim[2] altezza complessiva, vDim[3] proiezione del lato left sul bottom
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0))
EgtSetName( nBottomId, WIN_BOTTOM)
local nEdge1Id = EgtLine( nLayerId, Point3d( vDim[1], 0, 0), Point3d( vDim[3], vDim[2], 0))
local nEdge2Id = EgtLine( nLayerId, Point3d( vDim[3], vDim[2], 0), ORIG())
-- un lato verticale è right/left, un lato inclinato è top
if vDim[3] < GEO.EPS_SMALL then
EgtSetName( nEdge1Id, WIN_TOP)
EgtSetName( nEdge2Id, WIN_LEFT)
elseif abs( vDim[3] - vDim[1]) < GEO.EPS_SMALL then
EgtSetName( nEdge1Id, WIN_RIGHT)
EgtSetName( nEdge2Id, WIN_TOP)
else
EgtSetName( nEdge1Id, WIN_TOP)
EgtSetName( nEdge2Id, WIN_TOP)
end
end
return true
end
----------------------------------------------------------------------------------
-- funzione che crea il telaio a partire da una specifica geometria ( rettangolo, chamfer...)
function WinCreate.CreateFrame( nType, vDimensions, vJoints, vPartsDim, nAreaNbr)
-- creo gruppo per telaio
local nAreaId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
EgtSetLevel( nAreaId, GDB_LV.SYSTEM)
-- imposto le info
EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
EgtSetInfo( nAreaId, WIN_FRAME_TYPE, nType)
EgtSetInfo( nAreaId, WIN_JOINTS, vJoints)
EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim)
EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr)
-- costruisco le curve di outline
local nOutlineLayerId = EgtGroup( nAreaId)
EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE)
if not CreateFrameCurves( nOutlineLayerId, nType, vDimensions) then
return
end
return nAreaId
end
----------------------------------------------------------------------------------
-------------------------------------- ANTA --------------------------------------
----------------------------------------------------------------------------------
-- funzione che aggiunge una singola anta
function WinCreate.AddSash( nParentAreaId, vJoints, vPartsDim, nOpeningType, nAreaNbr)
-- se già presente area errore
if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then
return
end
-- creo nuova area
local nAreaId = EgtGroup( nParentAreaId)
EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SASH .. ')')
-- imposto le info
EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH)
EgtSetInfo( nAreaId, WIN_JOINTS, vJoints)
EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim)
EgtSetInfo( nAreaId, WIN_OPENING_TYPE, nOpeningType)
EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr)
EgtSetInfo( nAreaId, WIN_SASH_NBR, 1)
-- copio outline dall'area parent
CopyParentOutline( nAreaId, nParentAreaId)
return nAreaId
end
----------------------------------------------------------------------------------
-- funzione che aggiunge un gruppo di ante
function WinCreate.AddSashGroup( nParentAreaId, vMeasureTypes, vDimensions, vJoints, vPartsDim, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs)
-- se già presente sottoarea errore
if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then
return
end
-- creo gli split di tipo french
local vAreas = WinCreate.AddSplits( nParentAreaId, WIN_SPLITORIENTATION.VERTICAL, vMeasureTypes, vDimensions, {}, true, nAreaNbr)
-- trasformo le aree risultanti ( che sono null) nelle aree dell'anta settando le info opportune
for i = 1, #vAreas do
EgtSetName( vAreas[i], EgtGetName( vAreas[i]) .. '(' .. WIN_SASH .. ')')
EgtSetInfo( vAreas[i], WIN_AREATYPE, WIN_AREATYPES.SASH)
EgtSetInfo( vAreas[i], WIN_JOINTS, vJoints[i])
EgtSetInfo( vAreas[i], WIN_PART_DIM, vPartsDim[i])
EgtSetInfo( vAreas[i], WIN_SASHTYPE, vSashTypes[i])
EgtSetInfo( vAreas[i], WIN_OPENING_TYPE, vOpeningTypes[i])
if vSashNbrs then
EgtSetInfo( vAreas[i], WIN_SASH_NBR, vSashNbrs[i])
end
end
return vAreas
end
----------------------------------------------------------------------------------
-------------------------------------- FILL --------------------------------------
----------------------------------------------------------------------------------
-- funzione che aggiunge un riempimento
function WinCreate.AddFill( nParentAreaId, nFillType, nAreaNbr)
-- se area ha già sottoarea errore
if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then
return
end
local nAreaId = EgtGroup( nParentAreaId)
EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_FILL .. ')')
-- setto le info
EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.FILL)
EgtSetInfo( nAreaId, WIN_FILLTYPE, nFillType)
EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr)
-- copio outline dall'area parent
CopyParentOutline( nAreaId, nParentAreaId)
return nAreaId
end
----------------------------------------------------------------------------------
------------------------------------- SPLIT --------------------------------------
----------------------------------------------------------------------------------
-- funzione che assegna il nome alla curva di split nella sottoarea in base alla sua direzione
local function SetSplitName( nSplitId)
local vtMedia = ( ( EgtEV( nSplitId) + EgtSV( nSplitId)) / 2)
if not vtMedia:normalize() then
vtMedia = EgtSV( nSplitId)
end
if abs( vtMedia:getX()) > abs( vtMedia:getY()) then
if vtMedia:getX() > 0 then
EgtSetName( nSplitId, WIN_BOTTOM)
else
EgtSetName( nSplitId, WIN_TOP)
end
else
if vtMedia:getY() > 0 then
EgtSetName( nSplitId, WIN_RIGHT)
else
EgtSetName( nSplitId, WIN_LEFT)
end
end
end
----------------------------------------------------------------------------------
-- funzione che taglia lo split con il bordo della regione
local function AdjustSplitCurve( nSplitId, nCompo, vOutlineCrvs, nOutlineLayerId)
-- trimmo lo split a filo con l'outline
EgtExtendCurveStartByLen( nSplitId, 10)
EgtExtendCurveEndByLen( nSplitId, 10)
local ptS = EgtIP( nSplitId, nCompo, EgtSP( nSplitId))
local ptE = EgtIP( nSplitId, nCompo, EgtEP( nSplitId))
local dParS = EgtCurveParamAtPoint( nSplitId, ptS)
local dParE = EgtCurveParamAtPoint( nSplitId, ptE)
EgtTrimCurveStartEndAtParam( nSplitId, dParS, dParE)
-- recupero le curve con cui avviene l'intersezione e le salvo come info
-- start
local dParCrvS = EgtCurveParamAtPoint( nCompo, ptS)
if abs( dParCrvS - ceil( dParCrvS)) < GEO.EPS_ZERO then
local nCrv = vOutlineCrvs[ ceil( dParCrvS) + 1]
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nOther, nCrv})
elseif abs( dParCrvS - floor( dParCrvS)) < GEO.EPS_ZERO then
local nCrv = vOutlineCrvs[ floor( dParCrvS) + 1]
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nOther, nCrv})
else
-- se il parametro non è intero allora l'intersezione coinvolge una sola curva
local nCrv = vOutlineCrvs[ floor( dParCrvS) + 1]
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nCrv})
end
-- end
local dParCrvE = EgtCurveParamAtPoint( nCompo, ptE)
if abs( dParCrvE - ceil( dParCrvE)) < GEO.EPS_ZERO then
local nCrv = vOutlineCrvs[ ceil( dParCrvE) + 1]
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nOther, nCrv})
elseif abs( dParCrvE - floor( dParCrvE)) < GEO.EPS_ZERO then
local nCrv = vOutlineCrvs[ floor( dParCrvE) + 1]
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nOther, nCrv})
else
local nCrv = vOutlineCrvs[ floor( dParCrvE) + 1]
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nCrv})
end
end
----------------------------------------------------------------------------------
-- funzione che restituisce il bordo delle due regioni definite da uno split
local function GetBorderRegions( nSplitId, nCompo, nAreaId)
-- taglio il bordo in due in corrispondenza dello split
local nCrv1 = EgtCopyGlob( nCompo, nAreaId)
local nCrv2 = EgtCopyGlob( nCompo, nAreaId)
local dPar1 = EgtCurveParamAtPoint( nCompo, EgtSP( nSplitId), 100 * GEO.EPS_SMALL)
local dPar2 = EgtCurveParamAtPoint( nCompo, EgtEP( nSplitId), 100 * GEO.EPS_SMALL)
EgtTrimCurveStartEndAtParam( nCrv1, dPar2, dPar1)
EgtTrimCurveStartEndAtParam( nCrv2, dPar1, dPar2)
-- aggiungo la curva di split al bordo per chiuderlo orientandola opportunamente
local nSplitId1 = EgtCopyGlob( nSplitId, nAreaId)
if AreSamePointApprox( EgtSP( nSplitId1), EgtSP( nCrv1)) then
EgtInvertCurve( nSplitId1)
end
EgtAddCurveCompoCurve( nCrv1, nSplitId1)
local _, dParE1 = EgtCurveDomain( nCrv1)
EgtCurveCompoSetTempProp( nCrv1, dParE1 - 1, nSplitId)
local nSplitId2 = EgtCopyGlob( nSplitId, nAreaId)
if AreSamePointApprox( EgtSP( nSplitId2), EgtSP( nCrv2)) then
EgtInvertCurve( nSplitId2)
end
EgtAddCurveCompoCurve( nCrv2, nSplitId2)
local _, dParE2 = EgtCurveDomain( nCrv2)
EgtCurveCompoSetTempProp( nCrv2, dParE2 - 1, nSplitId)
return nCrv1, nCrv2
end
----------------------------------------------------------------------------------
-- funzione che crea le aree generate da una sequenza di curve di split
local function CreateAreasFromSplits( nAreaId, vSplitCrvs)
local nGrpTmp = EgtGroup( nAreaId)
-- creo la curva composita dell'outline
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
local vOutlineCrvs = EgtGetAllInGroup( nOutlineLayerId)
local nCompo = EgtCurveCompo( nGrpTmp, vOutlineCrvs, false)
for i = 1, #vOutlineCrvs do
EgtCurveCompoSetTempProp( nCompo, i - 1, vOutlineCrvs[i])
end
-- creo le curve associate ad ogni regione degli split
local vBorders = {}
local nCompoRef = nCompo
for i = 1, #vSplitCrvs do
-- aggiusto lo split per averlo a filo con l'outline
AdjustSplitCurve( vSplitCrvs[i], nCompo, vOutlineCrvs, nOutlineLayerId)
-- calcolo i bordi delle due regioni definite dallo split
local nCrv1, nCrv2 = GetBorderRegions( vSplitCrvs[i], nCompoRef, nGrpTmp)
table.insert( vBorders, nCrv1)
-- il secondo bordo è quello da suddividere con lo split successivo ( se esiste)
nCompoRef = nCrv2
if i == #vSplitCrvs then
table.insert( vBorders, nCrv2)
end
end
-- creo le sottoaree a partire dai contorni
local vAreas = {}
for i = 1, #vBorders do
-- creo area
local nSplitAreaId = EgtGroup( nAreaId)
EgtSetName( nSplitAreaId , WIN_AREA .. tostring( i))
EgtSetInfo( nSplitAreaId, WIN_AREATYPE, WIN_AREATYPES.NULL)
vAreas[i] = nSplitAreaId
-- creo outline con la curva di bordo
local nOutlineLayerId = EgtGroup( nSplitAreaId)
EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE)
EgtRelocateGlob( vBorders[i], nOutlineLayerId)
local vOrigCrvs = EgtCurveCompoGetTempProp( vBorders[i])
local nFirst, nCnt = EgtExplodeCurveCompo( vBorders[i])
-- assegno nome e info a tutte le curve di bordo a partire dalla curva da cui derviano ( salvata nella temp prop della curva)
for j = 0, nCnt - 1 do
-- assegno le info di child e source
EgtSetInfo( nFirst + j, WIN_SOU, vOrigCrvs[j+1])
AddInfo( vOrigCrvs[j+1], WIN_CHILD, nFirst + j)
-- assengo il nome : se deriva da outline lo copio, se deriva da split lo scelgo in base all'orientamento
if EgtGetName( vOrigCrvs[j+1]) == WIN_SPLIT then
SetSplitName( nFirst + j)
else
EgtSetName( nFirst + j, EgtGetName( vOrigCrvs[j+1]))
end
end
-- riordino le curve dell'outline per avere bottom come primo
local nCrvId = EgtGetFirstInGroup( nOutlineLayerId)
while EgtGetName( nCrvId) ~= WIN_BOTTOM do
EgtRelocate( nCrvId, nOutlineLayerId)
nCrvId = EgtGetFirstInGroup( nOutlineLayerId)
end
end
EgtErase( nGrpTmp)
return vAreas
end
----------------------------------------------------------------------------------
-- funzione che calcola le dimensioni assolute delle divisioni
local function CalcSplitDimensions( vMeasureTypes, vValues, dDim)
local vDimensions = {}
-- calcolo le dimensioni di tutti gli split assoluti e percentuali e calcolo i valori di riferimento per eventuali split proporzionali
local nPropTot = 0
local dPropDim = dDim
local bProportional = false
for i = 1, #vMeasureTypes do
if vMeasureTypes[i] == WIN_MEASURE.ABSOLUTE then
vDimensions[i] = vValues[i]
dPropDim = dPropDim - vDimensions[i]
elseif vMeasureTypes[i] == WIN_MEASURE.PERCENTAGE then
vDimensions[i] = dDim * vValues[i] / 100
dPropDim = dPropDim - vDimensions[i]
elseif vMeasureTypes[i] == WIN_MEASURE.PROPORTIONAL then
nPropTot = nPropTot + vValues[i]
bProportional = true
end
end
-- calcolo le dimensioni degli split proporzionali
if bProportional then
if dPropDim < GEO.EPS_SMALL then
return {}
end
for i = 1, #vValues do
if vMeasureTypes[i] == WIN_MEASURE.PROPORTIONAL then
vDimensions[i] = dPropDim * vValues[i] / nPropTot
end
end
end
return vDimensions
end
----------------------------------------------------------------------------------
local function CalcSplitCurves( nLayerId, b3OutlineLayer, b3Limit, nSplitType, vMeasureTypes, vValues)
-- calcolo le dimensioni assolute di tutti gli split
local vDimensions = CalcSplitDimensions( vMeasureTypes, vValues, EgtIf( nSplitType == WIN_SPLITORIENTATION.VERTICAL, b3OutlineLayer:getDimX(), b3OutlineLayer:getDimY()))
local vSplitCurves = {}
local dPosition = 0
for i = 1, #vDimensions do
-- calcolo la posizione cumulata
dPosition = dPosition + vDimensions[i]
local nSplitCrv
if nSplitType == WIN_SPLITORIENTATION.VERTICAL then
-- aree ordinate da sx a dx
local dCurrPosition = dPosition
-- creo la linea se rientra nella regione limite
local dX = b3OutlineLayer:getMin():getX() + dCurrPosition
if dX > b3Limit:getMin():getX() + GEO.EPS_SMALL and dX < b3Limit:getMax():getX() - GEO.EPS_SMALL then
nSplitCrv = EgtLinePVL( nLayerId, b3OutlineLayer:getMin() + X_AX() * dCurrPosition, Y_AX(), b3OutlineLayer:getDimY())
end
elseif nSplitType == WIN_SPLITORIENTATION.HORIZONTAL then
-- aree ordinate dall'alto al basso
local dCurrPosition = b3OutlineLayer:getDimY() - dPosition
-- creo la linea se rientra nella regione limite
local dY = b3OutlineLayer:getMin():getY() + dCurrPosition
if dY > b3Limit:getMin():getY() + GEO.EPS_SMALL and dY < b3Limit:getMax():getY() - GEO.EPS_SMALL then
nSplitCrv = EgtLinePVL( nLayerId, b3OutlineLayer:getMin() + Y_AX() * dCurrPosition, X_AX(), b3OutlineLayer:getDimX())
end
end
if nSplitCrv then
EgtSetName( nSplitCrv, WIN_SPLIT)
table.insert( vSplitCurves, nSplitCrv)
EgtSetInfo( nSplitCrv, WIN_SPLIT_POSITION, dPosition)
end
end
return vSplitCurves
end
----------------------------------------------------------------------------------
-- funzione che crea tagli split multipli
function WinCreate.AddSplits( nParentAreaId, nSplitType, vMeasureTypes, vValues, vPartsDim, bFrench, nAreaNbr)
-- se area ha già sottoarea errore
if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then
return
end
local nParentOutlineLayerId = EgtGetFirstNameInGroup( nParentAreaId, WIN_AREAOUTLINE)
local b3OutlineLayer = EgtGetBBox( nParentOutlineLayerId, GDB_BB.STANDARD)
-- creo area di split
local nAreaId = EgtGroup( nParentAreaId)
EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SPLIT .. ')')
-- setto le info
EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SPLIT)
EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr)
EgtSetInfo( nAreaId, WIN_SPLIT_DIR, nSplitType)
EgtSetInfo( nAreaId, WIN_MEASURE_TYPE, vMeasureTypes)
EgtSetInfo( nAreaId, WIN_MEASURE_VALUE, vValues)
EgtSetInfo( nAreaId, WIN_SPLIT_REF_DIM, EgtIf( nSplitType == WIN_SPLITORIENTATION.VERTICAL, b3OutlineLayer:getDimX(), b3OutlineLayer:getDimY()))
EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim)
-- copio il contorno dall'area parent
CopyParentOutline( nAreaId, nParentAreaId)
-- creo layer per split
local nSplitLayerId = EgtGroup( nAreaId)
EgtSetName( nSplitLayerId, WIN_BASESPLIT)
-- verifico se va impostato il tipo french
if bFrench then
EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, WIN_SPLITTYPES.FRENCH)
end
-- creo le curve di split
local vSplitCurves = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3OutlineLayer, nSplitType, vMeasureTypes, vValues)
if #vSplitCurves == 0 then
-- se non ci sono curve valide cancello tutto ed esco
EgtErase( nAreaId)
return
end
-- creo le aree generate dagli split
local vAreas = CreateAreasFromSplits( nAreaId, vSplitCurves)
return vAreas
end
----------------------------------------------------------------------------------
-- funzione che crea tagli split grid
function WinCreate.AddGridSplits( nParentAreaId, vVertMeasureTypes, vVertValues, vHorizMeasureTypes, vHorizValues, bStartVertical, vPartsDim, nAreaNbr)
local AreaResult = {}
-- se area ha già sottoarea errore
if EgtGetFirstNameInGroup( nParentAreaId, WIN_AREA .. '*') then
return
end
-- creo area di split
local nAreaId = EgtGroup( nParentAreaId)
EgtSetName( nAreaId, WIN_AREA .. '(' .. WIN_SPLIT .. ')')
-- setto info
EgtSetInfo( nAreaId, WIN_AREATYPE, WIN_AREATYPES.SPLIT)
EgtSetInfo( nAreaId, WIN_AREA_NBR, nAreaNbr)
EgtSetInfo( nAreaId, WIN_GRID_SPLIT, true)
EgtSetInfo( nAreaId, WIN_PART_DIM, vPartsDim)
-- copio il contorno dall'area parent e setto opportune corrispondenze sou/child
local nOutlineLayerId = CopyParentOutline( nAreaId, nParentAreaId)
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
-- creo layer per split
local nSplitLayerId = EgtGroup( nAreaId)
EgtSetName( nSplitLayerId, WIN_BASESPLIT)
-- stabilisco direzione principale e secondaria
local vMainTypes, vOtherTypes, vMainValues, vOtherValues, nMainSplitOrientation, nOtherSplitOrientation
if bStartVertical then
vMainTypes = vVertMeasureTypes
vMainValues = vVertValues
nMainSplitOrientation = WIN_SPLITORIENTATION.VERTICAL
vOtherTypes = vHorizMeasureTypes
vOtherValues = vHorizValues
nOtherSplitOrientation = WIN_SPLITORIENTATION.HORIZONTAL
else
vMainTypes = vHorizMeasureTypes
vMainValues = vHorizValues
nMainSplitOrientation = WIN_SPLITORIENTATION.HORIZONTAL
vOtherTypes = vVertMeasureTypes
vOtherValues = vVertValues
nOtherSplitOrientation = WIN_SPLITORIENTATION.VERTICAL
end
-- salvo i dati dello split principale nell'area principale, i dati dello split secondario verranno salvati nelle aree virtuali
EgtSetInfo( nAreaId, WIN_SPLIT_DIR, nMainSplitOrientation)
EgtSetInfo( nAreaId, WIN_MEASURE_TYPE, vMainTypes)
EgtSetInfo( nAreaId, WIN_MEASURE_VALUE, vMainValues)
EgtSetInfo( nAreaId, WIN_SPLIT_REF_DIM, EgtIf( nMainSplitOrientation == WIN_SPLITORIENTATION.VERTICAL, b3OutlineLayer:getDimX(), b3OutlineLayer:getDimY()))
-- calcolo la suddivisione nella direzione principale
local vMainSplit = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3OutlineLayer, nMainSplitOrientation, vMainTypes, vMainValues)
for i = 1, #vMainSplit do
EgtSetInfo( vMainSplit[i], WIN_GRIDSPLIT_ORDER, 0)
end
local vMainAreas = CreateAreasFromSplits( nAreaId, vMainSplit)
-- per ogni area della direzione principale calcolo la suddivisione nella direzione secondaria
for i = 1, #vMainAreas do
-- recupero outline per calcolare il limite delle curve di split
local nAreaOutlineLayerId = EgtGetFirstNameInGroup( vMainAreas[i], WIN_AREAOUTLINE)
local b3Limit = EgtGetBBox( nAreaOutlineLayerId, GDB_BB.STANDARD)
-- calcolo gli split nella direzione secondaria
local vOtherSplit = CalcSplitCurves( nSplitLayerId, b3OutlineLayer, b3Limit, nOtherSplitOrientation, vOtherTypes, vOtherValues)
if #vOtherSplit > 0 then
for j = 1, #vOtherSplit do
EgtSetInfo( vOtherSplit[j], WIN_GRIDSPLIT_ORDER, tostring( i))
end
-- calcolo le aree generate dagli split secondari
local vNewAreas = CreateAreasFromSplits( vMainAreas[i], vOtherSplit)
AreaResult = EgtJoinTables( AreaResult, vNewAreas)
end
end
-- sposto le aree secondarie nell'area di split e le rinomino
for i = 1, #AreaResult do
EgtRelocateGlob( AreaResult[i], nAreaId)
EgtSetName( AreaResult[i], WIN_AREA .. EgtNumToString( i))
end
-- le aree generate dallo split principale diventano aree virtuali ausiliarie per i conti
-- riporto come info quelle legate allo split secondario
for i = 1, #vMainAreas do
EgtSetName( vMainAreas[i], WIN_VIRTUAL_AREA)
EgtSetInfo( vMainAreas[i], WIN_SPLIT_DIR, nOtherSplitOrientation)
EgtSetInfo( vMainAreas[i], WIN_MEASURE_TYPE, vOtherTypes)
EgtSetInfo( vMainAreas[i], WIN_MEASURE_VALUE, vOtherValues)
EgtSetInfo( vMainAreas[i], WIN_SPLIT_REF_DIM, EgtIf( nOtherSplitOrientation == WIN_SPLITORIENTATION.VERTICAL, b3OutlineLayer:getDimX(), b3OutlineLayer:getDimY()))
end
return AreaResult
end
----------------------------------------------------------------------------------
---------------------------------- BOTTOMRAIL ------------------------------------
----------------------------------------------------------------------------------
-- funzione che aggiunge uno zoccolo
function WinCreate.AddBottomRail( nAreaId, nNbr, vDim)
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
if nAreaType == WIN_AREATYPES.FRAME or nAreaType == WIN_AREATYPES.SASH then
EgtSetInfo( nAreaId, WIN_BOTTOMRAIL, nNbr)
EgtSetInfo( nAreaId, WIN_BOTTOMRAIL .. WIN_PART_DIM, vDim)
end
end
----------------------------------------------------------------------------------
---------------------------------- SOGLIA ------------------------------------
----------------------------------------------------------------------------------
-- funzione che aggiunge la soglia
function WinCreate.AddThreshold( nAreaId, sThresholdProfile)
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
if nAreaType == WIN_AREATYPES.FRAME then
EgtSetInfo( nAreaId, WIN_THRESHOLD_PROFILE, sThresholdProfile)
end
end
----------------------------------------------------------------------------------
---------------------------------- FERRAMENTA ------------------------------------
----------------------------------------------------------------------------------
function WinCreate.AddHardware( nFrameId, sFavourite, sHandle)
EgtSetInfo( nFrameId, WIN_HDW_FAVOURITE, sFavourite)
EgtSetInfo( nFrameId, WIN_HDW_HANDLE, sHandle)
end
---------------------------------------------------------------------
return WinCreate
+417
View File
@@ -0,0 +1,417 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinManageProject = {}
-- Include
require( 'WinJWDConst')
local WinCreate = require( 'WinCreate')
local JSON = require( 'JSON')
---------------------------------------------------------------------
local function GetJoints( tJoints)
local vJoints = {}
for i = 1, #tJoints do
local nIndex = tJoints[i][JWD_INDEX]
if tJoints[i][JWD_JOINT_TYPE] == 'FULL_H' then
vJoints[nIndex] = WIN_JNT.FULL_H
elseif tJoints[i][JWD_JOINT_TYPE] == 'FULL_V' then
vJoints[nIndex] = WIN_JNT.FULL_V
elseif tJoints[i][JWD_JOINT_TYPE] == 'ANGLED' then
vJoints[nIndex] = WIN_JNT.ANGLED
end
end
return vJoints
end
---------------------------------------------------------------------
local function GetDimensions( tDimensions)
local vDims = {}
for i = 1, #tDimensions do
local nIndex = tDimensions[i][JWD_INDEX]
vDims[nIndex] = tDimensions[i][JWD_VALUE]
end
return vDims
end
---------------------------------------------------------------------
local function GetSplitDimensions( tDimensions)
local vDims = {}
for i = 1, #tDimensions do
local nIndex = tDimensions[i][JWD_INDEX]
local nArea = tDimensions[i][JWD_SPLIT_AREA]
if not vDims[nArea] then
vDims[nArea] = {}
end
vDims[nArea][nIndex] = tDimensions[i][JWD_VALUE]
end
return vDims
end
---------------------------------------------------------------------
local function GetFrameShape( sShape)
if sShape == 'RECTANGLE' then
return WIN_FRAME_TYPES.RECT
elseif sShape == 'RIGHTCHAMFER' or sShape == 'LEFTCHAMFER' then
return WIN_FRAME_TYPES.CHAMFER_SIDE
elseif sShape == 'DOUBLECHAMFER' then
return WIN_FRAME_TYPES.CHAMFER
elseif sShape == 'ARC_FULL' then
return WIN_FRAME_TYPES.ROUND_ARC
elseif sShape == 'ARC' then
return WIN_FRAME_TYPES.SEGMENTAL_ARC
elseif sShape == 'DOUBLEARC' then
return WIN_FRAME_TYPES.POINTED_ARC
elseif sShape == 'THREECENTERARC' then
return WIN_FRAME_TYPES.THREE_CENTER_ARC
elseif sShape == 'TRIANGLE' then
return WIN_FRAME_TYPES.TRG
end
end
---------------------------------------------------------------------
local function GetOpeningType( sOpeningType)
if sOpeningType == 'NULL' then
return WIN_OPENING_TYPES.NULL
elseif sOpeningType == 'TURNONLY_LEFT' then
return WIN_OPENING_TYPES.TURNONLY_LEFT
elseif sOpeningType == 'TURNONLY_RIGHT' then
return WIN_OPENING_TYPES.TURNONLY_RIGHT
elseif sOpeningType == 'TILTTURN_LEFT' then
return WIN_OPENING_TYPES.TILTTURN_LEFT
elseif sOpeningType == 'TILTTURN_RIGHT' then
return WIN_OPENING_TYPES.TILTTURN_RIGHT
elseif sOpeningType == 'TILTONLY_TOP' then
return WIN_OPENING_TYPES.TILTONLY_TOP
elseif sOpeningType == 'TILTONLY_BOTTOM' then
return WIN_OPENING_TYPES.TILTONLY_BOTTOM
elseif sOpeningType == 'PIVOT' then
return WIN_OPENING_TYPES.PIVOT
elseif sOpeningType == 'FIXED' then
return WIN_OPENING_TYPES.FIXED
elseif sOpeningType == 'COPLANARSLIDE_LEFT' then
return WIN_OPENING_TYPES.COPLANARSLIDE_LEFT
elseif sOpeningType == 'COPLANARSLIDE_RIGHT' then
return WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT
elseif sOpeningType == 'LIFTSLIDE_LEFT' then
return WIN_OPENING_TYPES.LIFTSLIDE_LEFT
elseif sOpeningType == 'LIFTSLIDE_RIGHT' then
return WIN_OPENING_TYPES.LIFTSLIDE_RIGHT
end
end
---------------------------------------------------------------------
local function GetMeasureType( sMeasureType)
if sMeasureType == 'ABSOLUTE' then
return WIN_MEASURE.ABSOLUTE
elseif sMeasureType == 'PROPORTIONAL' then
return WIN_MEASURE.PROPORTIONAL
elseif sMeasureType == 'PERCENTAGE' then
return WIN_MEASURE.PERCENTAGE
end
return WIN_MEASURE.PERCENTAGE
end
---------------------------------------------------------------------
-- funzione che ricava la tipologia dell'anta in base al tipo di apertura e alla struttura
local function GetSashTypes( tSashes, vOpeningTypes)
-- alzante scorrevole
local bSlideWindow = ( vOpeningTypes[1] == WIN_OPENING_TYPES.FIXED or vOpeningTypes[1] == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT or vOpeningTypes[1] == WIN_OPENING_TYPES.LIFTSLIDE_RIGHT)
if bSlideWindow then
if #tSashes == 2 then
if vOpeningTypes[1] == WIN_OPENING_TYPES.FIXED then
return { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE}, 'Dx'
elseif vOpeningTypes[2] == WIN_OPENING_TYPES.FIXED then
return { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED}, 'Sx'
else
-- TODO individuare parametro per disinguerle
return { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK}, 'Sx'
end
else
if vOpeningTypes[1] == WIN_OPENING_TYPES.FIXED then
return { WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED}, 'Sx'
elseif vOpeningTypes[2] == WIN_OPENING_TYPES.FIXED then
return { WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_FIXED, WIN_SASHTYPES.SLIDE_MOVABLE}, 'Sx'
else
return { WIN_SASHTYPES.SLIDE_MOVABLE_BACK, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE, WIN_SASHTYPES.SLIDE_MOVABLE_BACK}, 'Sx'
end
end
end
-- casi standard
if #tSashes == 2 then
if tSashes[1][JWD_HAS_HANDLE] then
return { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE}, 'Sx'
else
return { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE}, 'Dx'
end
elseif #tSashes == 3 then
if tSashes[1][JWD_HAS_HANDLE] then
return { WIN_SASHTYPES.ACTIVE, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT}, 'Sx'
elseif tSashes[2][JWD_HAS_HANDLE] then
if vOpeningTypes[2] == WIN_OPENING_TYPES.TURNONLY_LEFT or vOpeningTypes[2] == WIN_OPENING_TYPES.TILTTURN_LEFT then
return { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE}, 'Sx'
else
return { WIN_SASHTYPES.INACTIVE, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.ACTIVE_OUT}, 'Dx'
end
else
return { WIN_SASHTYPES.INACTIVE_OUT, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.ACTIVE}, 'Dx'
end
else
if tSashes[2][JWD_HAS_HANDLE] then
return { WIN_SASHTYPES.ACTIVE_OUT, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.INACTIVE_OUT}, 'Sx'
else
return { WIN_SASHTYPES.INACTIVE_OUT, WIN_SASHTYPES.INACTIVE_IN, WIN_SASHTYPES.ACTIVE_IN, WIN_SASHTYPES.ACTIVE_OUT}, 'Dx'
end
end
end
---------------------------------------------------------------------
-- funzione ricorsiva che legge le aree in tabella e crea le geometrie
local function ConvertTableToGeometry( AreaTable, nParentId)
if not AreaTable then
return
end
-- recupero numerazione
local nAreaNbr = AreaTable[JWD_ID_GROUP]
-- TELAIO
if AreaTable[JWD_AREA_TYPE] == 'FRAME' then
-- recupero i dati del telaio ( forma, giunzioni, dimensioni)
local nType = GetFrameShape( AreaTable[JWD_FRAME_SHAPE])
local vJoints = GetJoints( AreaTable[JWD_JOINTS])
local vDim = GetDimensions( AreaTable[JWD_DIMENSION_LIST])
local vElementDim = GetDimensions( AreaTable[JWD_ELEMENT_DIMENSION])
-- creo il telaio
local nAreaId = WinCreate.CreateFrame( nType, vDim, vJoints, vElementDim, nAreaNbr)
if not nAreaId then
return
end
-- verifico presenza threshold
if AreaTable[JWD_THRESHOLD] then
WinCreate.AddThreshold( nAreaId, AreaTable[JWD_THRESHOLD])
end
-- verifico presenza bottomrail
if AreaTable[JWD_BOTTOMRAIL] then
local vElementDim = GetDimensions( AreaTable[JWD_BR_ELEMENT_DIMENSION])
WinCreate.AddBottomRail( nAreaId, AreaTable[JWD_BOTTOMRAIL_QTY], vElementDim)
end
-- analizzo sottoaree
if AreaTable[JWD_AREA_LIST] then
ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][1], nAreaId)
end
return nAreaId
-- ANTA
elseif AreaTable[JWD_AREA_TYPE] == 'SASH' then
-- recupero dati
local tSashes = AreaTable[JWD_SASH_LIST]
local nBottomRailNbr = 0
local vElementDim = GetDimensions( AreaTable[JWD_BR_ELEMENT_DIMENSION])
if AreaTable[JWD_BOTTOMRAIL] then
nBottomRailNbr = AreaTable[JWD_BOTTOMRAIL_QTY]
end
-- lettura opzioni ferramenta
local HdwOptions = AreaTable[JWD_HARDWARE_OPTIONS] or {}
local vsOptions = {}
for i = 1, #HdwOptions do
local sName = HdwOptions[i][JWD_NAME]
local sValue = HdwOptions[i][JWD_VALUE]
table.insert( vsOptions, sName .. '=' .. sValue)
end
-- anta singola
if #tSashes == 1 then
local vJoints = GetJoints( tSashes[1][JWD_JOINTS])
local nOpeningType = GetOpeningType( tSashes[1][JWD_OPENING_TYPE])
local vElementDim = GetDimensions( tSashes[1][JWD_ELEMENT_DIMENSION])
local nAreaId = WinCreate.AddSash( nParentId, vJoints, vElementDim, nOpeningType, nAreaNbr)
-- aggiungo ferramenta sull'anta
local sHandleSide
if nOpeningType == WIN_OPENING_TYPES.TURNONLY_LEFT or
nOpeningType == WIN_OPENING_TYPES.TILTTURN_LEFT or
nOpeningType == WIN_OPENING_TYPES.TILTONLY_TOP or
nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_LEFT or
nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_LEFT then
sHandleSide = 'Sx'
elseif nOpeningType == WIN_OPENING_TYPES.TURNONLY_RIGHT or
nOpeningType == WIN_OPENING_TYPES.TILTTURN_RIGHT or
nOpeningType == WIN_OPENING_TYPES.TILTONLY_BOTTOM or
nOpeningType == WIN_OPENING_TYPES.COPLANARSLIDE_RIGHT or
nOpeningType == WIN_OPENING_TYPES.LIFTSLIDE_RIGHT then
sHandleSide = 'Dx'
end
WinCreate.AddHardware( nAreaId, AreaTable[JWD_HARDWARE], sHandleSide)
EgtSetInfo( nAreaId, WIN_HDW_OPTIONS, vsOptions)
-- bottomrail
WinCreate.AddBottomRail( nAreaId, nBottomRailNbr, vElementDim)
-- analizzo sottaree
ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][1], nAreaId)
-- ante multiple
else
-- recupero dati delle ante
local vDimensions = {}
local vOpeningTypes = {}
local vMeasureType = {}
local vSashNbrs = {}
local vJoints = {}
local vPartsDim = {}
for i = 1, #tSashes do
vMeasureType[i] = GetMeasureType( tSashes[i][JWD_MEASURE_TYPE])
vDimensions[i] = tSashes[i][JWD_DIMENSION]
vOpeningTypes[i] = GetOpeningType( tSashes[i][JWD_OPENING_TYPE])
vSashNbrs[i] = tSashes[i][JWD_ID_SASH]
vJoints[i] = GetJoints( tSashes[i][JWD_JOINTS])
vPartsDim[i] = GetDimensions( tSashes[i][JWD_ELEMENT_DIMENSION])
end
local vSashTypes, sHandleSide = GetSashTypes( tSashes, vOpeningTypes)
-- aggiungo il gruppo di ante
local vAreas = WinCreate.AddSashGroup( nParentId, vMeasureType, vDimensions, vJoints, vPartsDim, vSashTypes, vOpeningTypes, nAreaNbr, vSashNbrs)
-- aggiungo le ante
for i = 1, #vAreas do
-- bottomrail
WinCreate.AddBottomRail( vAreas[i], nBottomRailNbr, vElementDim)
-- analizzo sottaree
ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][i], vAreas[i])
end
-- aggiungo la ferramenta sull'area split
local nSplitAreaId = EgtGetParent( vAreas[1])
WinCreate.AddHardware( nSplitAreaId, AreaTable[JWD_HARDWARE], sHandleSide)
EgtSetInfo( nSplitAreaId, WIN_HDW_OPTIONS, vsOptions)
end
-- FILL
elseif AreaTable[JWD_AREA_TYPE] == 'FILL' then
local nFillType = EgtIf( AreaTable[JWD_FILL_TYPE] == 'GLASS', WIN_FILLTYPES.GLASS, WIN_FILLTYPES.WOOD)
WinCreate.AddFill( nParentId, nFillType, nAreaNbr)
-- SPLIT
elseif AreaTable[JWD_AREA_TYPE] == 'SPLIT' then
local vVertDimensions = {}
local vVertMeasureType = {}
local vVertElementDimension = GetSplitDimensions(AreaTable[JWD_ELEMENT_VERT_DIMENSION])
local vSplitVertDimensions = AreaTable[JWD_SPLIT_VERT_POS]
for i = 1, #vSplitVertDimensions do
vVertMeasureType[i] = GetMeasureType( vSplitVertDimensions[i][JWD_MEASURE_TYPE])
vVertDimensions[i] = vSplitVertDimensions[i][JWD_DIMENSION]
end
local vHorizDimensions = {}
local vHorizMeasureType = {}
local vHorizElementDimension = GetSplitDimensions(AreaTable[JWD_ELEMENT_HORIZ_DIMENSION])
local vSplitHorizDimensions = AreaTable[JWD_SPLIT_HORIZ_POS]
for i = 1, #vSplitHorizDimensions do
vHorizMeasureType[i] = GetMeasureType( vSplitHorizDimensions[i][JWD_MEASURE_TYPE])
vHorizDimensions[i] = vSplitHorizDimensions[i][JWD_DIMENSION]
end
local vSplitAreas
if AreaTable[JWD_SPLIT_TYPE] == 'GRID' then
local vElementDimension = {}
if AreaTable[JWD_SPLIT_START_VERT] then
vElementDimension = vVertElementDimension[0]
for i = 1, #vHorizElementDimension do
EgtJoinTables( vElementDimension, vHorizElementDimension[i])
end
else
vElementDimension = vHorizElementDimension[0]
for i = 1, #vVertElementDimension do
EgtJoinTables( vElementDimension, vVertElementDimension[i])
end
end
vSplitAreas = WinCreate.AddGridSplits( nParentId, vVertMeasureType, vVertDimensions, vHorizMeasureType, vHorizDimensions, AreaTable[JWD_SPLIT_START_VERT], vElementDimension, nAreaNbr)
elseif AreaTable[JWD_SPLIT_TYPE] == 'VERTICAL' then
vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.VERTICAL, vVertMeasureType, vVertDimensions, vVertElementDimension[0], false, nAreaNbr)
else
vSplitAreas = WinCreate.AddSplits( nParentId, WIN_SPLITORIENTATION.HORIZONTAL, vHorizMeasureType, vHorizDimensions, vHorizElementDimension[0], false, nAreaNbr)
end
for i = 1, #vSplitAreas do
ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][i], vSplitAreas[i])
end
-- NULL
elseif AreaTable[JWD_AREA_TYPE] == 'SPLITTED' then
EgtSetInfo( nParentId, WIN_AREA_NBR, nAreaNbr)
if AreaTable[JWD_AREA_LIST] then
ConvertTableToGeometry( AreaTable[JWD_AREA_LIST][1], nParentId)
end
end
end
---------------------------------------------------------------------
-- funzione che dato un file in json ne crea il progetto gerarchico
function WinManageProject.ReadFromFile( sFilePath, sProfileDir)
-- leggo il file
local SouFh = io.open( sFilePath, "rb")
if not SouFh then
EgtOutBox( 'Error opening ' .. sFilePath, 'ReadFromFile', 'ERROR')
return false
end
local content = SouFh:read( "*all")
SouFh:close()
local tData = JSON:decode( content)
-- importo il profilo
local sProfilePath = sProfileDir .. '\\' .. tData[JWD_PROFILE_PATH] .. '.nge'
if not WinCreate.ImportProfile( sProfilePath) then
return false
end
-- creo le aree
return ConvertTableToGeometry( tData[JWD_AREA_LIST][1], GDB_ID.ROOT)
end
---------------------------------------------------------------------
-- funzione che apre un file jwd
function WinManageProject.ReadFromJwd( sJwd)
local tData = JSON:decode( sJwd)
-- importo il profilo
local sProfilePath = _G.sProfilePath .. '\\' .. tData[JWD_PROFILE_PATH] .. '.nge'
if not WinCreate.ImportProfile( sProfilePath) then
return false
end
-- creo le aree
return ConvertTableToGeometry( tData[JWD_AREA_LIST][1], GDB_ID.ROOT)
end
---------------------------------------------------------------------
return WinManageProject
@@ -15,8 +15,7 @@
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
-- EgtEnableDebug( false)
EgtEnableDebug( false)
-- Imposto direttorio per librerie
local sBaseDir = EgtGetSourceDir()
@@ -25,13 +24,18 @@ EgtAddToPackagePath( sBaseDir .. '?.lua')
EgtAddToPackagePath( sBaseDir .. 'WinLib\\' .. '?.lua')
_G.package.loaded.WinConst = nil
require( 'WinConst')
_G.package.loaded.WinJWDConst = nil
_G.package.loaded.WinCreate = nil
local WinCreate = require( 'WinCreate')
_G.package.loaded.WinCalculate = nil
local WinCalculate = require( 'WinCalculate')
_G.package.loaded.WinManageProject = nil
_G.package.loaded.JSON = nil
_G.package.loaded.xml2lua = nil
_G.package.loaded.xml2lua_tree = nil
require( 'WinConst')
local WinManageProject = require( 'WinManageProject')
local WinCalculate = require( 'WinCalculate')
local sOpenFilePath = ''
-- verifico se lanciato file in batch per test
@@ -39,7 +43,7 @@ if WINDOW and WINDOW.FILE then
sOpenFilePath = WINDOW.FILE
else
-- altrimenti apro dialogo di scelta file
local sOpenDirPath = 'c:\\EgtData\\EgwWindowLua\\Projects'
local sOpenDirPath = 'c:\\EgtData\\EgtWindowMaker\\Projects'
local FilePathList = EgtFindAllFiles( sOpenDirPath .. '\\*.jwd')
local sDialogFile = 'CB:'
for FilePathIndex = 1, #FilePathList do
@@ -58,18 +62,32 @@ EgtNewFile()
EgtStartCounter()
--local sFileName = 'RoundArc_FixedGlass_Vertical&HorizontalSplit.jwd'
if not WinManageProject.ReadFromFile( sOpenFilePath) then
local sProfileDir = 'C:\\EgtData\\EgtWindowMaker\\Profiles'
if not WinManageProject.ReadFromFile( sOpenFilePath, sProfileDir) then
return
end
local sFilePath = EgtChangePathExtension( sOpenFilePath, 'nge')
EgtSetCurrFilePath( sFilePath)
-- imposto se calcolare i solidi o meno
WinCalculate.SetCalcSolid( true)
--WinCalculate.SetCalcPreview( true)
-- creo i pezzi
local nFrameId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREAASTERISK)
local nFrameId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREA .. '*')
WinCalculate.CreatePartFromArea( nFrameId)
WinCalculate.AddSplitDowelToParts( nFrameId)
WinCalculate.AddHardware( nFrameId, true, false, false, false)
WinCalculate.AddAccessories( nFrameId, true)
-- elimino profilo se in batch per test
if WINDOW and WINDOW.TEST and WINDOW.TEST == 1 then
local nProfileGroupId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
if nProfileGroupId and nProfileGroupId ~= GDB_ID.NULL then
EgtErase( nProfileGroupId)
end
end
EgtZoom( SCE_ZM.ALL)
+546
View File
@@ -0,0 +1,546 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio per librerie
local sBaseDir = EgtGetSourceDir()
EgtOutLog("BaseDir=" .. sBaseDir)
EgtAddToPackagePath( sBaseDir .. '?.lua')
EgtAddToPackagePath( sBaseDir .. 'WinLib\\' .. '?.lua')
_G.package.loaded.WinConst = nil
_G.package.loaded.WinJWDConst = nil
_G.package.loaded.WinCreate = nil
_G.package.loaded.WinCalculate = nil
_G.package.loaded.WinManageProject = nil
_G.package.loaded.JSON = nil
_G.package.loaded.xml2lua = nil
_G.package.loaded.xml2lua_tree = nil
require( 'WinConst')
local WinCreate = require( 'WinCreate')
local WinManageProject = require( 'WinManageProject')
local WinCalculate = require( 'WinCalculate')
-- WDG
-- funzioni
----------------------------------------------------------------------------------
local function GetVariableList( sName)
local List = {}
local nIndex = 1
while WDG[sName .. nIndex] do
table.insert(List, WDG[sName .. nIndex])
nIndex = nIndex + 1
end
return List
end
----------------------------------------------------------------------------------
local function CleanVariableList( sName)
local nIndex = 1
while WDG[sName .. nIndex] do
WDG[sName .. nIndex] = nil
nIndex = nIndex + 1
end
end
----------------------------------------------------------------------------------
local function FillVariableList( sName, List)
CleanVariableList( sName)
for i = 1, #List do
WDG[sName .. i] = List[i]
end
end
----------------------------------------------------------------------------------
local function GetAreaIdsFromNumbers( vAreaNbrs)
-- inizializzo la lista
local vAreaIds = {}
for i = 1, #vAreaNbrs do
vAreaIds[i] = GDB_ID.NULL
end
-- recupero le aree richieste
local vStack = { EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREA .. '*')}
local i = 1
while vStack[i] do
local nAreaNbr = EgtGetInfo( vStack[i], WIN_AREA_NBR, 'i') or -1
for j = 1, #vAreaNbrs do
if nAreaNbr == vAreaNbrs[j] then
vAreaIds[j] = vStack[i]
break
end
end
-- ricerco nelle sue sottoaree
local vChildren = EgtGetNameInGroup( vStack[i], WIN_AREA .. '*')
vStack = EgtJoinTables( vStack, vChildren)
i = i + 1
end
return vAreaIds
end
----------------------------------------------------------------------------------
local function SetProfilePath()
_G.sProfilePath = WDG.PROFILEPATH
end
_G.SetProfilePath = SetProfilePath
----------------------------------------------------------------------------------
local function WinCreate_ImportProfile()
_G.sProfile = WDG.PROFILE
if _G.sProfilePath then
WinCreate.ImportProfile( _G.sProfilePath .. '\\' .. WDG.PROFILE .. '.nge')
end
end
_G.WinCreate_ImportProfile = WinCreate_ImportProfile
----------------------------------------------------------------------------------
local function FindThresholds( nGrpId)
local tThresholds = {} -- array delle soglie
-- ogni soglia è una tabella con due chiavi : nType = intero che indica la tipologia ( cfr. WIN_THRESHOLD_TYPES), sName = nome della soglia nel file dei profili
local tHash = {}
-- scorro tutti i profili del telaio
local nCurrId = EgtGetFirstInGroup( nGrpId)
while nCurrId do
-- verifico se di tipo bottom
local nBottomType = EgtGetInfo( nCurrId, WIN_BOTTOM, 'i') or WIN_THRESHOLD_TYPES.NULL
if nBottomType ~= WIN_THRESHOLD_TYPES.NULL then
-- recupero il nome
local vNames = EgtSplitString( EgtGetName( nCurrId), '_')
local sName = vNames[#vNames]
if not tHash[sName] then
table.insert( tThresholds, { nType = nBottomType, sName = sName})
tHash[sName] = 1
end
end
nCurrId = EgtGetNext( nCurrId)
end
return tThresholds
end
----------------------------------------------------------------------------------
local function GetProfileThresholdsList()
local tThresholds = {}
if _G.sProfile == WDG.PROFILE then
-- se profilo corrente
local nProfileGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local nFrameGrp = EgtGetFirstNameInGroup( nProfileGrp, WIN_FRAME)
tThresholds = FindThresholds( nFrameGrp)
else
-- importo temporaneamente il profilo
local nLastId = EgtGetLastInGroup( GDB_ID.ROOT)
local bOk = EgtInsertFile( _G.sProfilePath .. '\\' .. WDG.PROFILE .. '.nge')
local nCurrId = EgtGetNext( nLastId or GDB_ID.NULL) or EgtGetFirstInGroup( GDB_ID.ROOT)
while nCurrId do
if EgtGetName( nCurrId) == WIN_FRAME then
tThresholds = FindThresholds( nCurrId)
end
-- passo al successivo e cancello il corrente
local nOldId = nCurrId
nCurrId = EgtGetNext( nCurrId)
EgtErase( nOldId)
end
end
WDG.THRESHOLDSLIST = tThresholds
end
_G.GetProfileThresholdsList = GetProfileThresholdsList
----------------------------------------------------------------------------------
local function GetProfileData( nFrameGrp, nSashGrp)
local tData = {}
-- a) dimensioni
for i = 1, 2 do
-- scorro tutti i profili e salvo le dimensioni
local sName = EgtIf( i == 1, WIN_FRAME, WIN_SASH)
local vProfiles = EgtGetAllInGroup( EgtIf( i ==1, nFrameGrp, nSashGrp))
for j = 1, #vProfiles do
local sCurrName = sName .. '_' .. EgtGetName( vProfiles[j])
tData[sCurrName .. '_' .. WIN_DIM_STD] = EgtGetInfo( vProfiles[j], WIN_DIM_STD, 'd')
tData[sCurrName .. '_' .. WIN_DIM_MIN] = EgtGetInfo( vProfiles[j], WIN_DIM_MIN, 'd')
tData[sCurrName .. '_' .. WIN_DIM_MAX] = EgtGetInfo( vProfiles[j], WIN_DIM_MAX, 'd')
end
end
-- b) overlap
-- tra ante e telaio
local vProfiles = EgtGetAllInGroup( nFrameGrp)
for i = 1, #vProfiles do
local dTopOverlap = EgtGetInfo( vProfiles[i], WIN_SASH_TOP_OVERLAP, 'd')
local dBottomOverlap = EgtGetInfo( vProfiles[i], WIN_SASH_BOTTOM_OVERLAP, 'd')
if dTopOverlap and dBottomOverlap then
tData[EgtGetName( vProfiles[i]) .. '_' .. WIN_TOP .. '_' .. WIN_OVERLAP] = dTopOverlap
tData[EgtGetName( vProfiles[i]) .. '_' .. WIN_BOTTOM .. '_' .. WIN_OVERLAP] = dBottomOverlap
else
tData[EgtGetName( vProfiles[i]) .. '_' .. WIN_OVERLAP] = dTopOverlap or dBottomOverlap
end
end
-- tra ante battenti/riceventi
local nSashActive = EgtGetFirstNameInGroup( nSashGrp, WIN_SASH_ACTIVE)
if nSashActive then
tData[WIN_SASH_ACTIVE .. '_' .. WIN_OVERLAP] = EgtGetInfo( nSashActive, WIN_OVERLAP, 'd')
end
local nSashFrench = EgtGetFirstNameInGroup( nSashGrp, WIN_FRENCH_IN)
if nSashFrench then
tData[WIN_FRENCH_IN .. '_' .. WIN_OVERLAP] = EgtGetInfo( nSashFrench, WIN_OVERLAP, 'd')
end
local nSlideActive = EgtGetFirstNameInGroup( nSashGrp, WIN_SLIDE_ACTIVE)
if nSlideActive then
tData[WIN_SLIDE_ACTIVE .. '_' .. WIN_OVERLAP] = EgtGetInfo( nSlideActive, WIN_OVERLAP, 'd')
end
-- tra bottomrail
local nFrameBottomRail = EgtGetFirstNameInGroup( nFrameGrp, WIN_RAIL_BOTTOM)
if nFrameBottomRail then
tData[WIN_FRAME .. '_'.. WIN_BOTTOMRAIL .. '_' .. WIN_OVERLAP] = EgtGetInfo( nFrameBottomRail, WIN_OVERLAP, 'd')
end
local nSashBottomRail = EgtGetFirstNameInGroup( nSashGrp, WIN_RAIL_BOTTOM)
if nSashBottomRail then
tData[WIN_SASH .. '_'.. WIN_BOTTOMRAIL .. '_' .. WIN_OVERLAP] = EgtGetInfo( nSashBottomRail, WIN_OVERLAP, 'd')
end
return tData
end
----------------------------------------------------------------------------------
local function WinGetProfileData()
local tData
if _G.sProfile == WDG.PROFILE then
-- se profilo corrente
local nProfileGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local nFrameGrp = EgtGetFirstNameInGroup( nProfileGrp, WIN_FRAME)
local nSashGrp = EgtGetFirstNameInGroup( nProfileGrp, WIN_SASH)
tData = GetProfileData( nFrameGrp, nSashGrp)
else
-- importo temporaneamente il profilo
local nLastId = EgtGetLastInGroup( GDB_ID.ROOT)
local bOk = EgtInsertFile( _G.sProfilePath .. '\\' .. WDG.PROFILE .. '.nge')
local nCurrId = EgtGetNext( nLastId or GDB_ID.NULL) or EgtGetFirstInGroup( GDB_ID.ROOT)
local vGrps = {}
while nCurrId do
table.insert( vGrps, nCurrId)
nCurrId = EgtGetNext( nCurrId)
end
tData = GetProfileData( vGrps[1], vGrps[2])
EgtErase( vGrps)
end
WDG.PROFILEDATA = tData
end
_G.WinGetProfileData = WinGetProfileData
----------------------------------------------------------------------------------
local function WinCreate_CreateFrame()
local JointList = GetVariableList( 'JOINT')
local DimensionList = GetVariableList( 'DIMENSION')
WDG.AREAID = WinCreate.CreateFrame( WDG.FRAMETYPE, JointList, DimensionList, WDG.AREANBR)
CleanVariableList('JOINT')
CleanVariableList('DIMENSION')
end
_G.WinCreate_CreateFrame = WinCreate_CreateFrame
----------------------------------------------------------------------------------
local function WinCreate_AddSash()
local JointList = GetVariableList( 'JOINT')
WDG.AREAID = WinCreate.AddSash( WDG.AREAID, JointList, WDG.OPENINGTYPE, WDG.AREANBR)
CleanVariableList( 'JOINT')
end
_G.WinCreate_AddSash = WinCreate_AddSash
----------------------------------------------------------------------------------
local function WinCreate_AddSashGroup()
local DimensionList = GetVariableList( 'DIMENSION')
local JointList = GetVariableList( 'JOINT')
local SashTypeList = GetVariableList( 'SASHTYPE')
local OpeningTypeList = GetVariableList( 'OPENINGTYPE')
local SashNbrList = GetVariableList( 'SASHNBR')
local AreaList = WinCreate.AddSashGroup( WDG.AREAID, WDG.MEASURETYPE, DimensionList, JointList, SashTypeList, OpeningTypeList, WDG.AREANBR, SashNbrList)
FillVariableList( 'AREAID', AreaList)
CleanVariableList( 'DIMENSION')
CleanVariableList( 'JOINT')
CleanVariableList( 'SASHTYPE')
CleanVariableList( 'OPENINGTYPE')
CleanVariableList( 'SASHNBR')
end
_G.WinCreate_AddSashGroup = WinCreate_AddSashGroup
----------------------------------------------------------------------------------
local function WinCreate_AddHardware()
WinCreate.AddHardware( WDG.AREAID, WDG.FAVOURITE, WDG.HANDLE)
end
_G.WinCreate_AddHardware = WinCreate_AddHardware
----------------------------------------------------------------------------------
local function WinCreate_AddFill()
WDG.AREAID = WinCreate.AddFill( WDG.AREAID, WDG.FILLTYPE, WDG.AREANBR)
end
_G.WinCreate_AddFill = WinCreate_AddFill
----------------------------------------------------------------------------------
local function WinCreate_AddBottomRail()
WinCreate.AddBottomRail( WDG.AREAID, WDG.NBR)
end
_G.WinCreate_AddBottomRail = WinCreate_AddBottomRail
----------------------------------------------------------------------------------
local function WinCreate_AddThreshold()
WinCreate.AddThreshold( WDG.AREAID, WDG.THRESHOLDPROFILE)
end
_G.WinCreate_AddThreshold = WinCreate_AddThreshold
----------------------------------------------------------------------------------
local function WinCreate_AddSplits()
local PositionList = GetVariableList( 'POSITION')
local AreaList = WinCreate.AddSplits( WDG.AREAID, WDG.SPLITORIENTATION, WDG.MEASURETYPE, PositionList, false, WDG.AREANBR)
FillVariableList( 'AREAID', AreaList)
CleanVariableList( 'POSITION')
end
_G.WinCreate_AddSplits = WinCreate_AddSplits
----------------------------------------------------------------------------------
local function WinCreate_AddGridSplits()
local PositionListVert = GetVariableList( 'POSITION_VERT')
local PositionListHoriz = GetVariableList( 'POSITION_HORIZ')
local AreaList = WinCreate.AddGridSplits( WDG.AREAID, WDG.MEASURETYPE, PositionListVert, PositionListHoriz, WDG.STARTVERTICAL, WDG.AREANBR)
FillVariableList( 'AREAID', AreaList)
CleanVariableList( 'POSITION_VERT')
CleanVariableList( 'POSITION_HORIZ')
end
_G.WinCreate_AddGridSplits = WinCreate_AddGridSplits
----------------------------------------------------------------------------------
local function WinCalculate_SetCalcSolid()
WinCalculate.SetCalcSolid( WDG.VALUE)
end
_G.WinCalculate_SetCalcSolid = WinCalculate_SetCalcSolid
----------------------------------------------------------------------------------
local function WinCalculate_SetSimplifiedSolid()
WinCalculate.SetSimplifiedSolid( WDG.VALUE)
end
_G.WinCalculate_SetSimplifiedSolid = WinCalculate_SetSimplifiedSolid
----------------------------------------------------------------------------------
local function WinCalculate_SetCalcPreview()
WinCalculate.SetCalcPreview( WDG.VALUE)
end
_G.WinCalculate_SetCalcPreview = WinCalculate_SetCalcPreview
----------------------------------------------------------------------------------
local function WinCalculate_CreatePartFromArea()
WinCalculate.CreatePartFromArea( WDG.FRAMEID)
end
_G.WinCalculate_CreatePartFromArea = WinCalculate_CreatePartFromArea
----------------------------------------------------------------------------------
local function WinCalculate_RecalcSolids()
WinCalculate.RecalcSolids( WDG.FRAMEID)
end
_G.WinCalculate_RecalcSolids = WinCalculate_RecalcSolids
----------------------------------------------------------------------------------
local function WinCalculate_AddHardware()
WDG.HARDWAREKIT_LIST, WDG.HARDWAREPOSITION_LIST, WDG.HARDWAREOPTION_LIST = WinCalculate.AddHardware( WDG.FRAMEID, WDG.CALC_MACHINING, WDG.CALC_HARDWARELIST, WDG.CALC_POSITIONLIST, WDG.CALC_OPTIONLIST)
end
_G.WinCalculate_AddHardware = WinCalculate_AddHardware
----------------------------------------------------------------------------------
local function WinCalculate_AddHardwareByGroupId()
-- recupero gli id geometrici delle aree richieste
local vAreaNbrs = GetVariableList( 'AREANBR')
local vAreaIds = GetAreaIdsFromNumbers( vAreaNbrs)
for i = 1, #vAreaIds do
if vAreaIds[i] ~= GDB_ID.NULL then
WDG['HARDWAREKIT_LIST' .. tostring(i)], WDG['HARDWAREPOSITION_LIST' .. tostring(i)], WDG['HARDWAREOPTION_LIST' .. tostring(i)] =
WinCalculate.AddHardware( vAreaIds[i], WDG.CALC_MACHINING, WDG.CALC_HARDWARELIST, WDG.CALC_POSITIONLIST, WDG.CALC_OPTIONLIST)
end
end
end
_G.WinCalculate_AddHardwareByGroupId = WinCalculate_AddHardwareByGroupId
----------------------------------------------------------------------------------
local function WinCalculate_AddAccessories()
WinCalculate.AddAccessories( WDG.FRAMEID, WDG.DRAW)
end
_G.WinCalculate_AddAccessories = WinCalculate_AddAccessories
----------------------------------------------------------------------------------
local function WinManage_LoadJwd()
WDG.AREAID = WinManageProject.ReadFromJwd( WDG.JWD)
end
_G.WinManage_LoadJwd = WinManage_LoadJwd
----------------------------------------------------------------------------------
local function WinGetImage()
-- sistemo la vista
EgtSetView( SCE_VD.TOP, false)
EgtZoom( SCE_ZM.ALL, false)
-- salvo immagine
EgtGetImage( SCE_SM.SH, EgtStdColor('WHITE'), EgtStdColor('WHITE'), 1920, 1080, WDG.FILE)
end
_G.WinGetImage = WinGetImage
----------------------------------------------------------------------------------
local function WinGetSvg()
-- sistemo la vista
EgtSetView( SCE_VD.TOP, false)
EgtZoom( SCE_ZM.ALL, false)
-- salvo immagine
EgtExportSvg( WDG.GROUPID, WDG.FILE, EEX_FLT.LEV_SYSTEM + EEX_FLT.MODE_STD + EEX_FLT.STAT_OFF)
end
_G.WinGetSvg = WinGetSvg
----------------------------------------------------------------------------------
local function WinSetAuxGrpStatus()
-- recupero il gruppo aux della ferramenta e accessori e assegno stato
local nAuxGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AUX) or GDB_ID.NULL
EgtSetStatus( nAuxGrp, EgtIf( WDG.AUXSTATUS, GDB_ST.ON, GDB_ST.OFF))
end
_G.WinSetAuxGrpStatus = WinSetAuxGrpStatus
----------------------------------------------------------------------------------
local function WinGetSectionsTotalLenghts()
WDG.SECTIONS_LENGTHS = {} -- array con le sezioni
-- ogni sezione è una tabella con le seguenti chiavi : w = spessore, h = altezza, l = array con le lunghezze dei pezzi di tale sezione
-- scorro tutti i pezzi
local nPartId = EgtGetFirstPart()
while nPartId do
local nPartType = EgtGetInfo( nPartId, WIN_PART_TYPE, 'i') or WIN_PART_TYPES.NULL
if nPartType ~= WIN_PART_TYPES.FILL then
-- recupero il gruppo logs ( per archi) o geo dove sono salvate le dimensioni del pezzo
local nLayerId = EgtGetFirstNameInGroup( nPartId, WIN_LOGS) or EgtGetFirstNameInGroup( nPartId, WIN_GEO) or GDB_ID.NULL
if nLayerId ~= GDB_ID.NULL then
local dWidth = EgtGetInfo( nLayerId, WIN_GEOWIDTH, 'd')
local dHeight = EgtGetInfo( nLayerId, WIN_GEOHEIGHT, 'd')
local dLen = EgtGetInfo( nLayerId, WIN_GEOLEN, 'd')
if dLen then
-- verfico se devo aggiornare sezione già presente o se devo aggiungerla
local bFound = false
for i = 1, #WDG.SECTIONS_LENGTHS do
if ( abs( WDG.SECTIONS_LENGTHS[i].W - dWidth) < GEO.EPS_SMALL and abs( WDG.SECTIONS_LENGTHS[i].H - dHeight) < GEO.EPS_SMALL) then
bFound = true
table.insert( WDG.SECTIONS_LENGTHS[i].L, dLen)
WDG.SECTIONS_LENGTHS[i].TotL = WDG.SECTIONS_LENGTHS[i].TotL + dLen
end
end
if not bFound then
table.insert( WDG.SECTIONS_LENGTHS, { W = dWidth, H = dHeight, L = {dLen}, TotL = dLen})
end
end
end
end
nPartId = EgtGetNextPart( nPartId)
end
end
_G.WinGetSectionsTotalLenghts = WinGetSectionsTotalLenghts
----------------------------------------------------------------------------------
local function WinGetGlassesList()
WDG.GLASSES_LIST = {} -- array dei vetri
-- ogni vetro è una tabella con le seguenti chiavi : bRect = true se rettangolo/false altrimenti, w/l/t sono le tre dimensioni
local nPartId = EgtGetFirstPart()
while nPartId do
local nFillType = EgtGetInfo( nPartId, WIN_FILLTYPE)
if nFillType == WIN_GLASS then
local nLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
local bShapeRect = EgtGetInfo( nLayerId, WIN_GLASS_RECT, 'b') or false
local dW = EgtGetInfo( nLayerId, WIN_GEOWIDTH, 'd') or 0
local dL = EgtGetInfo( nLayerId, WIN_GEOHEIGHT, 'd') or 0
local dT = EgtGetInfo( nLayerId, WIN_GLASSTHICKNESS, 'd') or 0
table.insert( WDG.GLASSES_LIST, { Rect = bShapeRect, W = dW, L = dL, T = dT})
end
nPartId = EgtGetNextPart( nPartId)
end
end
_G.WinGetGlassesList = WinGetGlassesList
----------------------------------------------------------------------------------
local function WinGetSashShape()
-- recupero gli id geometrici delle aree richieste
local vAreaNbrs = GetVariableList( 'AREANBR')
local vAreaIds = GetAreaIdsFromNumbers( vAreaNbrs)
-- ricavo le forme
for i = 1, #vAreaIds do
if vAreaIds[i] ~= GDB_ID.NULL then
WDG['SASHSHAPE' .. tostring( i)] = EgtGetInfo( vAreaIds[i], WIN_SASH_SHAPE)
end
end
end
_G.WinGetSashShape = WinGetSashShape
----------------------------------------------------------------------------------
local function WinGetAreaProfiles()
-- restituisce una lista dove ogni elemento è una tabella con le seguenti chiavi : GroupId = AREANBR corrispondente, EntId = sottoentità ( e.g. anta, area di split a griglia),
-- Profiles = lista dei profili dei pezzi di quell'area
-- recupero gli id geometrici delle aree richieste
local vAreaNbrs = GetVariableList( 'AREANBR')
local vAreaIds = GetAreaIdsFromNumbers( vAreaNbrs)
-- ricavo i profili
local tabProfiles = {}
for i = 1, #vAreaIds do
if vAreaIds[i] ~= GDB_ID.NULL then
local nAreaType = EgtGetInfo( vAreaIds[i], WIN_AREATYPE, 'i')
if nAreaType == WIN_AREATYPES.FRAME then
table.insert( tabProfiles, { GroupId = vAreaNbrs[i], EntId = -1, Profiles = EgtGetInfo( vAreaIds[i], WIN_AREA_PROFILES, 'vs')})
elseif nAreaType == WIN_AREATYPES.SASH then
table.insert( tabProfiles, { GroupId = vAreaNbrs[i], EntId = 1, Profiles = EgtGetInfo( vAreaIds[i], WIN_AREA_PROFILES, 'vs')})
elseif nAreaType == WIN_AREATYPES.SPLIT then
local nSplitLayId = EgtGetFirstNameInGroup( vAreaIds[i], WIN_SPLIT)
local nSplitType = EgtGetInfo( nSplitLayId, WIN_SPLITTYPE, 'i')
-- se french split devo recuperare le ante che definisce
if nSplitType == WIN_SPLITTYPES.FRENCH then
local vSashes = EgtGetNameInGroup( vAreaIds[i], WIN_AREA .. '*')
for j = 1, #vSashes do
local nSashId = EgtGetInfo( vSashes[j], WIN_SASH_NBR, 'i')
table.insert( tabProfiles, { GroupId = vAreaNbrs[i], EntId = nSashId, Profiles = EgtGetInfo( vSashes[j], WIN_AREA_PROFILES, 'vs')})
end
-- se split standard recupero i profili
else
local bGridSplit = EgtGetInfo( vAreaIds[i], WIN_GRID_SPLIT, 'b') or false
if bGridSplit then
-- distinguo per ordine di split
local nOrder = 0
local vProfiles = EgtGetInfo( vAreaIds[i], WIN_AREA_PROFILES .. tostring( nOrder), 'vs')
while vProfiles do
table.insert( tabProfiles, { GroupId = vAreaNbrs[i], EntId = nOrder, Profiles = vProfiles})
nOrder = nOrder + 1
vProfiles = EgtGetInfo( vAreaIds[i], WIN_AREA_PROFILES .. tostring( nOrder), 'vs')
end
else
table.insert( tabProfiles, { GroupId = vAreaNbrs[i], EntId = -1, Profiles = EgtGetInfo( vAreaIds[i], WIN_AREA_PROFILES, 'vs')})
end
end
end
end
end
WDG['AREAPROFILES'] = tabProfiles
end
_G.WinGetAreaProfiles = WinGetAreaProfiles
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

-271
View File
@@ -1,271 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
---- Imposto direttorio libreria specializzata per Nesting
--local sBaseDir = EgtGetSourceDir()
--EgtOutLog("BaseDir=" .. sBaseDir)
--EgtAddToPackagePath( sBaseDir .. '?.lua')
-- local Config = require( 'Config')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
-- Tipi di giunzioni (joint)
JNT = {
ANGLED = 1,
CP_H = 2,
CP_V = 3,
CP_M = 4
}
-- Tipi di profilo
PRF = {
NULL = 0,
TOP = 1,
BOTTOM = 2,
LEFT = 3,
RIGHT = 4,
VERTICAL = 5,
HORIZONTAL = 6
}
local CUT_SURF_EPS_SMALL = 0.05
local PROFILE = 'Profile'
local FRAME = 'Frame'
local OUTLINE = 'Outline'
local GEO = 'Geo'
local SOLID = 'Solid'
local BOTTOM = 'Bottom'
local RIGHT = 'Right'
local TOP = 'Top'
local LEFT = 'Left'
local SASH_TOP = 'Sash_Top'
local SASH_BOTTOM = 'Sash_Bottom'
local FIXED_TOP = 'Fixed_Top'
local FIXED_BOTTOM = 'Fixed_Bottom'
local REF = 'Ref'
local SECTION = 'Section'
local ALU = 'Alu'
local CTRIN = 'CtrIn'
local OUT = 'Out'
local OUTOFST = 'OutOfst'
local HoleHeight = 1200
local HoleWidth = 1200
local WindowWidth = 1200
local WindowHeight = 1200
local WindowTree
local sProfilePath = 'c:\\EgtData\\Window\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- funzioni
-- funzione che restituisce BBox del Ref del profilo
local function GetRefWithBBoxFromProfile( nProfileFrameId, sProfileType)
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameId, sProfileType)
local nProfileRefId = EgtGetFirstNameInGroup( nProfileId, REF)
local b3Ref = EgtGetBBox( nProfileRefId, GDB_BB.STANDARD)
return nProfileId, b3Ref
end
-- funzione che restituisce ref e calcola delta controprofilo dal profilo passatogli
local function GetDeltaProfile( nProfileFrameId, sProfileType)
local nProfileId, b3Ref = GetRefWithBBoxFromProfile( nProfileFrameId, sProfileType)
local nCPId = EgtGetFirstNameInGroup( nProfileId, CTRIN)
local b3CP = EgtGetBBox( nCPId, GDB_BB.STANDARD)
local dCPDelta = b3Ref:getDimY() - b3CP:getDimY()
return dCPDelta, b3Ref
end
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcFrameFootPrint( nProfileFrameId, nId, nGeoId)
-- ricavo tipo dal nome
local sName = EgtGetName( nId)
local nProfileType = PRF.NULL
if sName == TOP then
nProfileType = PRF.TOP
elseif sName == BOTTOM then
nProfileType = PRF.BOTTOM
elseif sName == LEFT then
nProfileType = PRF.LEFT
elseif sName == RIGHT then
nProfileType = PRF.RIGHT
end
local p3FrameStart = EgtSP( nId)
local p3FrameEnd = EgtEP( nId)
local nNewGeoId
if nProfileType == PRF.TOP then
-- recupero ref e controprofilo del top e calcolo delta
local _, b3TopRef = GetRefWithBBoxFromProfile( nProfileFrameId, SASH_TOP)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd - Y_AX() * b3TopRef:getDimY(), p3FrameStart)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, TOP)
elseif nProfileType == PRF.BOTTOM then
local _, b3BottomRef = GetRefWithBBoxFromProfile( nProfileFrameId, SASH_BOTTOM)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart, p3FrameEnd + Y_AX() * b3BottomRef:getDimY())
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3BottomRef:getDimX())
EgtSetName( nNewGeoId, BOTTOM)
elseif nProfileType == PRF.LEFT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd + Y_AX() * dBottomCPDelta , p3FrameStart + X_AX() * b3TopRef:getDimY() - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, LEFT)
elseif nProfileType == PRF.RIGHT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart - X_AX() * b3TopRef:getDimY() + Y_AX() * dBottomCPDelta , p3FrameEnd - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, RIGHT)
end
end
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtNewFile()
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, PROFILE)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- creo struttura layer del frame
local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nFrameLayerId, FRAME)
local nOutlineId = EgtGroup( nFrameLayerId)
EgtSetName( nOutlineId, OUTLINE)
local nGeoId = EgtGroup( nFrameLayerId)
EgtSetName( nGeoId, GEO)
local nSolidId = EgtGroup( nFrameLayerId)
EgtSetName( nSolidId, SOLID)
local nFrameProfileId = EgtGroup( nFrameLayerId)
EgtSetName( nFrameProfileId, PROFILE)
-- disegno outline
local nFrameBottomId = EgtLine( nOutlineId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0) )
EgtSetName( nFrameBottomId, BOTTOM)
local nFrameRightId = EgtLine( nOutlineId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0) )
EgtSetName( nFrameRightId, RIGHT)
local nFrameTopId = EgtLine( nOutlineId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0) )
EgtSetName( nFrameTopId, TOP)
local nFrameLeftId = EgtLine( nOutlineId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0) )
EgtSetName( nFrameLeftId, LEFT)
-- scelgo tipo di giunzioni
-- per il momento faccio controprofili verticali
-- scelgo il tipo
-- per il momento faccio controprofili per anta
-- disegno ingombri frame
local nProfileFrameId = EgtGetFirstNameInGroup( nProfileId, FRAME)
local nCurrOutlineId = EgtGetFirstInGroup( nOutlineId)
while nCurrOutlineId do
CalcFrameFootPrint( nProfileFrameId, nCurrOutlineId, nGeoId)
nCurrOutlineId = EgtGetNext( nCurrOutlineId)
end
-- posiziono profili
-- bottom
local nBottomProfileId = EgtGetFirstNameInGroup( nProfileFrameId, SASH_BOTTOM)
-- creo copia
local nBottomFrameProfileId = EgtCopy( nBottomProfileId, nFrameProfileId)
local b3BottomFrameProfile = EgtGetBBox( nBottomFrameProfileId, GDB_BB.STANDARD)
-- recupero posizione e BBox del geo
local nBottomGeoId = EgtGetFirstNameInGroup( nGeoId, BOTTOM)
local b3BottomGeo = EgtGetBBox(nBottomGeoId, GDB_BB.STANDARD)
EgtMove( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ() - Point3d( b3BottomFrameProfile:getMax():getX(), b3BottomFrameProfile:getMin():getY(), b3BottomGeo:getMax():getZ()))
EgtRotate( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ(), Y_AX(), -90)
-- recupero profilo outline e lo estrudo
local nBottomFrameOutlineId = EgtGetFirstNameInGroup( nBottomFrameProfileId, SECTION)
local nBottomExtrusionId = EgtSurfTmByExtrusion( nSolidId, nBottomFrameOutlineId, X_AX() * b3BottomGeo:getDimX())
EgtInvertSurf( nBottomExtrusionId)
-- copio e sposto profilo out left su start bottom per tagliarlo
local nLeftProfileId = EgtGetFirstNameInGroup( nProfileFrameId, SASH_TOP)
local nBottomOutLeftProfileId = EgtCopy( nLeftProfileId, nFrameProfileId)
EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), 90)
local b3BottomOutLeftProfileId = EgtGetBBoxGlob(nBottomOutLeftProfileId, GDB_BB.STANDARD)
EgtMove( nBottomOutLeftProfileId, b3BottomGeo:getMin() - b3BottomOutLeftProfileId:getMin())
local nOutLeftProfileId = EgtGetFirstNameInGroup( nBottomOutLeftProfileId, OUTOFST)
local nBottomOutLeftProfileExtrusionId = EgtSurfTmByExtrusion( nSolidId, nOutLeftProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidId)
EgtSurfTmCut( nBottomExtrusionId, nBottomOutLeftProfileExtrusionId, true, false)
EgtSurfTmCut( nBottomOutLeftProfileExtrusionId, nExtrCopyId, true, false)
--EgtErase( nExtrCopyId)
-- copio e sposto profilo out left su end bottom per tagliarlo
local nRightProfileId = EgtGetFirstNameInGroup( nProfileFrameId, SASH_TOP)
local nBottomOutRightProfileId = EgtCopy( nRightProfileId, nFrameProfileId)
EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), -90)
local b3BottomOutRightProfileId = EgtGetBBoxGlob(nBottomOutRightProfileId, GDB_BB.STANDARD)
EgtMove( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMax():getX(),b3BottomGeo:getMin():getY(),b3BottomGeo:getMin():getZ()) - Point3d( b3BottomOutRightProfileId:getMax():getX(), b3BottomOutRightProfileId:getMin():getY(),b3BottomOutRightProfileId:getMin():getZ()))
local nOutRightProfileId = EgtGetFirstNameInGroup( nBottomOutRightProfileId, OUTOFST)
local nBottomOutRightProfileExtrusionId = EgtSurfTmByExtrusion( nSolidId, nOutRightProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
--EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
--local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidId)
EgtSurfTmCut( nBottomExtrusionId, nBottomOutRightProfileExtrusionId, true, false)
EgtSurfTmCut( nBottomOutRightProfileExtrusionId, nExtrCopyId, true, false)
EgtErase( nExtrCopyId)
-338
View File
@@ -1,338 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
---- Imposto direttorio libreria specializzata per Nesting
--local sBaseDir = EgtGetSourceDir()
--EgtOutLog("BaseDir=" .. sBaseDir)
--EgtAddToPackagePath( sBaseDir .. '?.lua')
-- local Config = require( 'Config')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
-- Tipi di giunzioni (joint)
JNT = {
ANGLED = 1,
CP_H = 2,
CP_V = 3,
CP_M = 4
}
-- Tipi di profilo
PRF = {
NULL = 0,
TOP = 1,
BOTTOM = 2,
LEFT = 3,
RIGHT = 4,
VERTICAL = 5,
HORIZONTAL = 6
}
local CUT_SURF_EPS_SMALL = 0.05
local PROFILE = 'Profile'
local FRAME = 'Frame'
local OUTLINE = 'Outline'
local GEO = 'Geo'
local SOLID = 'Solid'
local BOTTOM = 'Bottom'
local RIGHT = 'Right'
local TOP = 'Top'
local LEFT = 'Left'
local SASH_TOP = 'Sash_Top'
local SASH_BOTTOM = 'Sash_Bottom'
local FIXED_TOP = 'Fixed_Top'
local FIXED_BOTTOM = 'Fixed_Bottom'
local REF = 'Ref'
local SECTION = 'Section'
local ALU = 'Alu'
local CTRIN = 'CtrIn'
local OUT = 'Out'
local OUTOFST = 'OutOfst'
local HoleHeight = 1200
local HoleWidth = 1200
local WindowWidth = 1200
local WindowHeight = 1200
local WindowTree
local sProfilePath = 'c:\\EgtData\\Window\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- funzioni
-- funzione che restituisce BBox del Ref del profilo
local function GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sProfileType)
local nProfileRefId = EgtGetFirstNameInGroup( nProfileId, REF)
local b3Ref = EgtGetBBox( nProfileRefId, GDB_BB.STANDARD)
return nProfileId, b3Ref
end
-- funzione che restituisce ref e calcola delta controprofilo dal profilo passatogli
local function GetDeltaProfile( nProfileFrameLayerId, sProfileType)
local nProfileId, b3Ref = GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nCPId = EgtGetFirstNameInGroup( nProfileId, CTRIN)
local b3CP = EgtGetBBox( nCPId, GDB_BB.STANDARD)
local dCPDelta = b3Ref:getDimY() - b3CP:getDimY()
return dCPDelta, b3Ref
end
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcFrameFootPrint( nProfileFrameLayerId, nId, nGeoId)
-- ricavo tipo dal nome
local sName = EgtGetName( nId)
local nProfileType = PRF.NULL
if sName == TOP then
nProfileType = PRF.TOP
elseif sName == BOTTOM then
nProfileType = PRF.BOTTOM
elseif sName == LEFT then
nProfileType = PRF.LEFT
elseif sName == RIGHT then
nProfileType = PRF.RIGHT
end
local p3FrameStart = EgtSP( nId)
local p3FrameEnd = EgtEP( nId)
local nNewGeoId
if nProfileType == PRF.TOP then
-- recupero ref e controprofilo del top e calcolo delta
local _, b3TopRef = GetRefWithBBoxFromProfile( nProfileFrameLayerId, SASH_TOP)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd - Y_AX() * b3TopRef:getDimY(), p3FrameStart)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, TOP)
elseif nProfileType == PRF.BOTTOM then
local _, b3BottomRef = GetRefWithBBoxFromProfile( nProfileFrameLayerId, SASH_BOTTOM)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart, p3FrameEnd + Y_AX() * b3BottomRef:getDimY())
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3BottomRef:getDimX())
EgtSetName( nNewGeoId, BOTTOM)
elseif nProfileType == PRF.LEFT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameLayerId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameLayerId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd + Y_AX() * dBottomCPDelta , p3FrameStart + X_AX() * b3TopRef:getDimY() - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, LEFT)
elseif nProfileType == PRF.RIGHT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameLayerId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameLayerId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart - X_AX() * b3TopRef:getDimY() + Y_AX() * dBottomCPDelta , p3FrameEnd - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, RIGHT)
end
end
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcFrameSolid( nProfileFrameLayerId, nGeoId, nFrameProfileLayerId, nGeoLayerId, nSolidLayerId)
-- ricavo tipo dal nome
local sName = EgtGetName( nGeoId)
local nProfileType = PRF.NULL
if sName == TOP then
nProfileType = PRF.TOP
elseif sName == BOTTOM then
nProfileType = PRF.BOTTOM
elseif sName == LEFT then
nProfileType = PRF.LEFT
elseif sName == RIGHT then
nProfileType = PRF.RIGHT
end
if nProfileType == PRF.TOP then
elseif nProfileType == PRF.BOTTOM then
local nBottomProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_BOTTOM)
-- creo copia
local nBottomFrameProfileId = EgtCopy( nBottomProfileId, nFrameProfileLayerId)
local b3BottomFrameProfile = EgtGetBBox( nBottomFrameProfileId, GDB_BB.STANDARD)
-- recupero posizione e BBox del geo
local nBottomGeoId = EgtGetFirstNameInGroup( nGeoLayerId, BOTTOM)
local b3BottomGeo = EgtGetBBox(nBottomGeoId, GDB_BB.STANDARD)
EgtMove( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ() - Point3d( b3BottomFrameProfile:getMax():getX(), b3BottomFrameProfile:getMin():getY(), b3BottomGeo:getMax():getZ()))
EgtRotate( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ(), Y_AX(), -90)
-- recupero profilo outline e lo estrudo
local nBottomFrameOutlineId = EgtGetFirstNameInGroup( nBottomFrameProfileId, SECTION)
local nBottomExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nBottomFrameOutlineId, X_AX() * b3BottomGeo:getDimX())
EgtInvertSurf( nBottomExtrusionId)
-- copio e sposto profilo out left su start bottom per tagliarlo
local nLeftProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
local nBottomOutLeftProfileId = EgtCopy( nLeftProfileId, nFrameProfileLayerId)
EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), 90)
local b3BottomOutLeftProfileId = EgtGetBBoxGlob(nBottomOutLeftProfileId, GDB_BB.STANDARD)
EgtMove( nBottomOutLeftProfileId, b3BottomGeo:getMin() - b3BottomOutLeftProfileId:getMin())
local nOutLeftProfileId = EgtGetFirstNameInGroup( nBottomOutLeftProfileId, OUTOFST)
local nBottomOutLeftProfileExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutLeftProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
EgtSurfTmCut( nBottomExtrusionId, nBottomOutLeftProfileExtrusionId, true, false)
EgtSurfTmCut( nBottomOutLeftProfileExtrusionId, nExtrCopyId, true, false)
--EgtErase( nExtrCopyId)
-- copio e sposto profilo out left su end bottom per tagliarlo
local nRightProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
local nBottomOutRightProfileId = EgtCopy( nRightProfileId, nFrameProfileLayerId)
EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), -90)
local b3BottomOutRightProfileId = EgtGetBBoxGlob(nBottomOutRightProfileId, GDB_BB.STANDARD)
EgtMove( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMax():getX(),b3BottomGeo:getMin():getY(),b3BottomGeo:getMin():getZ()) - Point3d( b3BottomOutRightProfileId:getMax():getX(), b3BottomOutRightProfileId:getMin():getY(),b3BottomOutRightProfileId:getMin():getZ()))
local nOutRightProfileId = EgtGetFirstNameInGroup( nBottomOutRightProfileId, OUTOFST)
local nBottomOutRightProfileExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutRightProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
--EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
--local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
EgtSurfTmCut( nBottomExtrusionId, nBottomOutRightProfileExtrusionId, true, false)
EgtSurfTmCut( nBottomOutRightProfileExtrusionId, nExtrCopyId, true, false)
EgtErase( nExtrCopyId)
elseif nProfileType == PRF.LEFT then
elseif nProfileType == PRF.RIGHT then
end
end
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtNewFile()
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, PROFILE)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- creo struttura layer del frame
local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nFrameLayerId, FRAME)
local nOutlineLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nOutlineLayerId, OUTLINE)
local nGeoLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nGeoLayerId, GEO)
local nSolidLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nSolidLayerId, SOLID)
local nFrameProfileLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nFrameProfileLayerId, PROFILE)
-- disegno outline
local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0) )
EgtSetName( nFrameBottomId, BOTTOM)
local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0) )
EgtSetName( nFrameRightId, RIGHT)
local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0) )
EgtSetName( nFrameTopId, TOP)
local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0) )
EgtSetName( nFrameLeftId, LEFT)
-- scelgo tipo di giunzioni
-- per il momento faccio controprofili verticali
-- scelgo il tipo
-- per il momento faccio controprofili per anta
-- disegno ingombri frame
local nProfileFrameLayerId = EgtGetFirstNameInGroup( nProfileId, FRAME)
local nCurrOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nCurrOutlineId do
CalcFrameFootPrint( nProfileFrameLayerId, nCurrOutlineId, nGeoLayerId)
nCurrOutlineId = EgtGetNext( nCurrOutlineId)
end
-- posiziono profili
local nGeoId = EgtGetFirstInGroup( nGeoLayerId)
CalcFrameSolid(nProfileFrameLayerId, nGeoId, nFrameProfileLayerId, nGeoLayerId, nSolidLayerId)
---- bottom
--local nBottomProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_BOTTOM)
---- creo copia
--local nBottomFrameProfileId = EgtCopy( nBottomProfileId, nFrameProfileLayerId)
--local b3BottomFrameProfile = EgtGetBBox( nBottomFrameProfileId, GDB_BB.STANDARD)
---- recupero posizione e BBox del geo
--local nBottomGeoId = EgtGetFirstNameInGroup( nGeoId, BOTTOM)
--local b3BottomGeo = EgtGetBBox(nBottomGeoId, GDB_BB.STANDARD)
--EgtMove( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ() - Point3d( b3BottomFrameProfile:getMax():getX(), b3BottomFrameProfile:getMin():getY(), b3BottomGeo:getMax():getZ()))
--EgtRotate( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ(), Y_AX(), -90)
---- recupero profilo outline e lo estrudo
--local nBottomFrameOutlineId = EgtGetFirstNameInGroup( nBottomFrameProfileId, SECTION)
--local nBottomExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nBottomFrameOutlineId, X_AX() * b3BottomGeo:getDimX())
--EgtInvertSurf( nBottomExtrusionId)
---- copio e sposto profilo out left su start bottom per tagliarlo
--local nLeftProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
--local nBottomOutLeftProfileId = EgtCopy( nLeftProfileId, nFrameProfileLayerId)
--EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
--EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), 90)
--local b3BottomOutLeftProfileId = EgtGetBBoxGlob(nBottomOutLeftProfileId, GDB_BB.STANDARD)
--EgtMove( nBottomOutLeftProfileId, b3BottomGeo:getMin() - b3BottomOutLeftProfileId:getMin())
--local nOutLeftProfileId = EgtGetFirstNameInGroup( nBottomOutLeftProfileId, OUTOFST)
--local nBottomOutLeftProfileExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutLeftProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
--EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
--local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
--EgtSurfTmCut( nBottomExtrusionId, nBottomOutLeftProfileExtrusionId, true, false)
--EgtSurfTmCut( nBottomOutLeftProfileExtrusionId, nExtrCopyId, true, false)
----EgtErase( nExtrCopyId)
---- copio e sposto profilo out left su end bottom per tagliarlo
--local nRightProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
--local nBottomOutRightProfileId = EgtCopy( nRightProfileId, nFrameProfileLayerId)
--EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
--EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), -90)
--local b3BottomOutRightProfileId = EgtGetBBoxGlob(nBottomOutRightProfileId, GDB_BB.STANDARD)
--EgtMove( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMax():getX(),b3BottomGeo:getMin():getY(),b3BottomGeo:getMin():getZ()) - Point3d( b3BottomOutRightProfileId:getMax():getX(), b3BottomOutRightProfileId:getMin():getY(),b3BottomOutRightProfileId:getMin():getZ()))
--local nOutRightProfileId = EgtGetFirstNameInGroup( nBottomOutRightProfileId, OUTOFST)
--local nBottomOutRightProfileExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutRightProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
----EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
----local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
--EgtSurfTmCut( nBottomExtrusionId, nBottomOutRightProfileExtrusionId, true, false)
--EgtSurfTmCut( nBottomOutRightProfileExtrusionId, nExtrCopyId, true, false)
--EgtErase( nExtrCopyId)
-266
View File
@@ -1,266 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
---- Imposto direttorio libreria specializzata per Nesting
--local sBaseDir = EgtGetSourceDir()
--EgtOutLog("BaseDir=" .. sBaseDir)
--EgtAddToPackagePath( sBaseDir .. '?.lua')
-- local Config = require( 'Config')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
-- Tipi di giunzioni (joint)
JNT = {
ANGLED = 1,
CP_H = 2,
CP_V = 3,
CP_M = 4
}
-- Tipi di profilo
PRF = {
NULL = 0,
TOP = 1,
BOTTOM = 2,
LEFT = 3,
RIGHT = 4,
VERTICAL = 5,
HORIZONTAL = 6
}
local CUT_SURF_EPS_SMALL = 0.05
local PROFILE = 'Profile'
local FRAME = 'Frame'
local OUTLINE = 'Outline'
local GEO = 'Geo'
local SOLID = 'Solid'
local BOTTOM = 'Bottom'
local RIGHT = 'Right'
local TOP = 'Top'
local LEFT = 'Left'
local SASH_TOP = 'Sash_Top'
local SASH_BOTTOM = 'Sash_Bottom'
local FIXED_TOP = 'Fixed_Top'
local FIXED_BOTTOM = 'Fixed_Bottom'
local REF = 'Ref'
local SECTION = 'Section'
local ALU = 'Alu'
local CTRIN = 'CtrIn'
local OUT = 'Out'
local OUTOFST = 'OutOfst'
local HoleHeight = 1200
local HoleWidth = 1200
local WindowWidth = 1200
local WindowHeight = 1200
local WindowTree
local sProfilePath = 'c:\\EgtData\\Window\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- funzioni
-- funzione che restituisce BBox del Ref del profilo
local function GetRefWithBBoxFromProfile( nProfileFrameId, sProfileType)
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameId, sProfileType)
local nProfileRefId = EgtGetFirstNameInGroup( nProfileId, REF)
local b3Ref = EgtGetBBox( nProfileRefId, GDB_BB.STANDARD)
return nProfileId, b3Ref
end
-- funzione che restituisce ref e calcola delta controprofilo dal profilo passatogli
local function GetDeltaProfile( nProfileFrameId, sProfileType)
local nProfileId, b3Ref = GetRefWithBBoxFromProfile( nProfileFrameId, sProfileType)
local nCPId = EgtGetFirstNameInGroup( nProfileId, CTRIN)
local b3CP = EgtGetBBox( nCPId, GDB_BB.STANDARD)
local dCPDelta = b3Ref:getDimY() - b3CP:getDimY()
return dCPDelta, b3Ref
end
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcFrameFootPrint( nProfileFrameId, nId, nGeoId)
-- ricavo tipo dal nome
local sName = EgtGetName( nId)
local nProfileType = PRF.NULL
if sName == TOP then
nProfileType = PRF.TOP
elseif sName == BOTTOM then
nProfileType = PRF.BOTTOM
elseif sName == LEFT then
nProfileType = PRF.LEFT
elseif sName == RIGHT then
nProfileType = PRF.RIGHT
end
local p3FrameStart = EgtSP( nId)
local p3FrameEnd = EgtEP( nId)
local nNewGeoId
if nProfileType == PRF.TOP then
-- recupero ref e controprofilo del top e calcolo delta
local _, b3TopRef = GetRefWithBBoxFromProfile( nProfileFrameId, SASH_TOP)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd - Y_AX() * b3TopRef:getDimY(), p3FrameStart)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, TOP)
elseif nProfileType == PRF.BOTTOM then
local _, b3BottomRef = GetRefWithBBoxFromProfile( nProfileFrameId, SASH_BOTTOM)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart, p3FrameEnd + Y_AX() * b3BottomRef:getDimY())
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3BottomRef:getDimX())
EgtSetName( nNewGeoId, BOTTOM)
elseif nProfileType == PRF.LEFT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd + Y_AX() * dBottomCPDelta , p3FrameStart + X_AX() * b3TopRef:getDimY() - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, LEFT)
elseif nProfileType == PRF.RIGHT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart - X_AX() * b3TopRef:getDimY() + Y_AX() * dBottomCPDelta , p3FrameEnd - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, RIGHT)
end
end
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtNewFile()
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, PROFILE)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- creo struttura layer del frame
local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nFrameLayerId, FRAME)
local nOutlineId = EgtGroup( nFrameLayerId)
EgtSetName( nOutlineId, OUTLINE)
local nGeoId = EgtGroup( nFrameLayerId)
EgtSetName( nGeoId, GEO)
local nSolidId = EgtGroup( nFrameLayerId)
EgtSetName( nSolidId, SOLID)
local nFrameProfileId = EgtGroup( nFrameLayerId)
EgtSetName( nFrameProfileId, PROFILE)
-- disegno outline
local nFrameBottomId = EgtLine( nOutlineId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0) )
EgtSetName( nFrameBottomId, BOTTOM)
local nFrameRightId = EgtLine( nOutlineId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0) )
EgtSetName( nFrameRightId, RIGHT)
local nFrameTopId = EgtLine( nOutlineId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0) )
EgtSetName( nFrameTopId, TOP)
local nFrameLeftId = EgtLine( nOutlineId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0) )
EgtSetName( nFrameLeftId, LEFT)
-- scelgo tipo di giunzioni
-- per il momento faccio controprofili verticali
-- scelgo il tipo
-- per il momento faccio controprofili per anta
-- disegno ingombri frame
local nProfileFrameId = EgtGetFirstNameInGroup( nProfileId, FRAME)
local nCurrOutlineId = EgtGetFirstInGroup( nOutlineId)
while nCurrOutlineId do
CalcFrameFootPrint( nProfileFrameId, nCurrOutlineId, nGeoId)
nCurrOutlineId = EgtGetNext( nCurrOutlineId)
end
-- posiziono profili
-- bottom
local nBottomProfileId = EgtGetFirstNameInGroup( nProfileFrameId, SASH_BOTTOM)
-- creo copia
local nBottomFrameProfileId = EgtCopy( nBottomProfileId, nFrameProfileId)
local b3BottomFrameProfile = EgtGetBBox( nBottomFrameProfileId, GDB_BB.STANDARD)
-- recupero posizione e BBox del geo
local nBottomGeoId = EgtGetFirstNameInGroup( nGeoId, BOTTOM)
local b3BottomGeo = EgtGetBBox(nBottomGeoId, GDB_BB.STANDARD)
EgtMove( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ() - Point3d( b3BottomFrameProfile:getMax():getX(), b3BottomFrameProfile:getMin():getY(), b3BottomGeo:getMax():getZ()))
EgtRotate( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ(), Y_AX(), -90)
-- recupero profilo outline e lo estrudo
local nBottomFrameOutlineId = EgtGetFirstNameInGroup( nBottomFrameProfileId, SECTION)
local nBottomExtrusionId = EgtSurfTmByExtrusion( nSolidId, nBottomFrameOutlineId, X_AX() * b3BottomGeo:getDimX())
EgtInvertSurf( nBottomExtrusionId)
-- copio e sposto profilo out left su start bottom per tagliarlo
local nLeftProfileId = EgtGetFirstNameInGroup( nProfileFrameId, SASH_TOP)
local nBottomOutLeftProfileId = EgtCopy( nLeftProfileId, nFrameProfileId)
EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), 90)
local b3BottomOutLeftProfileId = EgtGetBBoxGlob(nBottomOutLeftProfileId, GDB_BB.STANDARD)
EgtMove( nBottomOutLeftProfileId, b3BottomGeo:getMin() - b3BottomOutLeftProfileId:getMin())
local nOutLeftProfileId = EgtGetFirstNameInGroup( nBottomOutLeftProfileId, OUTOFST)
local nBottomOutLeftProfileExtrusionId = EgtSurfTmByExtrusion( nSolidId, nOutLeftProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidId)
EgtSurfTmCut( nBottomExtrusionId, nBottomOutLeftProfileExtrusionId, true, false)
EgtSurfTmCut( nBottomOutLeftProfileExtrusionId, nExtrCopyId, true, false)
EgtErase( nExtrCopyId)
--local nLeftProfileId = EgtGetFirstNameInGroup( nProfileFrameId, SASH_TOP)
--local nOutLeftProfileId = EgtGetFirstNameInGroup( nLeftProfileId, OUTOFST)
--local nBottomOutLeftProfileId = EgtCopy( nOutLeftProfileId, nFrameProfileId)
--EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
--EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), 90)
--local b3BottomOutLeftProfileId = EgtGetBBox(nBottomOutLeftProfileId, GDB_BB.STANDARD)
--EgtMove( nBottomOutLeftProfileId, b3BottomGeo:getMin() - b3BottomOutLeftProfileId:getMin())
--local nBottomOutLeftProfileExtrusionId = EgtSurfTmByExtrusion( nSolidId, nBottomOutLeftProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
--EgtSurfTmCut( nBottomOutLeftProfileExtrusionId, nBottomExtrusionId, true, false)
--EgtSurfTmCut( nBottomExtrusionId, nBottomOutLeftProfileExtrusionId, false, false)
-337
View File
@@ -1,337 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
---- Imposto direttorio libreria specializzata per Nesting
--local sBaseDir = EgtGetSourceDir()
--EgtOutLog("BaseDir=" .. sBaseDir)
--EgtAddToPackagePath( sBaseDir .. '?.lua')
-- local Config = require( 'Config')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
-- Tipi di giunzioni (joint)
JNT = {
ANGLED = 1,
CP_H = 2,
CP_V = 3,
CP_M = 4
}
-- Tipi di profilo
PRF = {
NULL = 0,
TOP = 1,
BOTTOM = 2,
LEFT = 3,
RIGHT = 4,
VERTICAL = 5,
HORIZONTAL = 6
}
local CUT_SURF_EPS_SMALL = 0.05
local PROFILE = 'Profile'
local FRAME = 'Frame'
local OUTLINE = 'Outline'
local GEO = 'Geo'
local SOLID = 'Solid'
local BOTTOM = 'Bottom'
local RIGHT = 'Right'
local TOP = 'Top'
local LEFT = 'Left'
local SASH_TOP = 'Sash_Top'
local SASH_BOTTOM = 'Sash_Bottom'
local FIXED_TOP = 'Fixed_Top'
local FIXED_BOTTOM = 'Fixed_Bottom'
local REF = 'Ref'
local SECTION = 'Section'
local ALU = 'Alu'
local CTRIN = 'CtrIn'
local OUT = 'Out'
local OUTOFST = 'OutOfst'
local HoleHeight = 1200
local HoleWidth = 1200
local WindowWidth = 1200
local WindowHeight = 1200
local WindowTree
local sProfilePath = 'c:\\EgtData\\Window\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- funzioni
-- funzione che restituisce BBox del Ref del profilo
local function GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sProfileType)
local nProfileRefId = EgtGetFirstNameInGroup( nProfileId, REF)
local b3Ref = EgtGetBBox( nProfileRefId, GDB_BB.STANDARD)
return nProfileId, b3Ref
end
-- funzione che restituisce ref e calcola delta controprofilo dal profilo passatogli
local function GetDeltaProfile( nProfileFrameLayerId, sProfileType)
local nProfileId, b3Ref = GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nCPId = EgtGetFirstNameInGroup( nProfileId, CTRIN)
local b3CP = EgtGetBBox( nCPId, GDB_BB.STANDARD)
local dCPDelta = b3Ref:getDimY() - b3CP:getDimY()
return dCPDelta, b3Ref
end
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcFrameFootPrint( nProfileFrameLayerId, nId, nGeoId)
-- ricavo tipo dal nome
local sName = EgtGetName( nId)
local nProfileType = PRF.NULL
if sName == TOP then
nProfileType = PRF.TOP
elseif sName == BOTTOM then
nProfileType = PRF.BOTTOM
elseif sName == LEFT then
nProfileType = PRF.LEFT
elseif sName == RIGHT then
nProfileType = PRF.RIGHT
end
local p3FrameStart = EgtSP( nId)
local p3FrameEnd = EgtEP( nId)
local nNewGeoId
if nProfileType == PRF.TOP then
-- recupero ref e controprofilo del top e calcolo delta
local _, b3TopRef = GetRefWithBBoxFromProfile( nProfileFrameLayerId, SASH_TOP)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd - Y_AX() * b3TopRef:getDimY(), p3FrameStart)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, TOP)
elseif nProfileType == PRF.BOTTOM then
local _, b3BottomRef = GetRefWithBBoxFromProfile( nProfileFrameLayerId, SASH_BOTTOM)
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart, p3FrameEnd + Y_AX() * b3BottomRef:getDimY())
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3BottomRef:getDimX())
EgtSetName( nNewGeoId, BOTTOM)
elseif nProfileType == PRF.LEFT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameLayerId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameLayerId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameEnd + Y_AX() * dBottomCPDelta , p3FrameStart + X_AX() * b3TopRef:getDimY() - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, LEFT)
elseif nProfileType == PRF.RIGHT then
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = GetDeltaProfile( nProfileFrameLayerId, SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = GetDeltaProfile( nProfileFrameLayerId, SASH_BOTTOM)
-- creo rettangolo ingombro
nNewGeoId = EgtRectangle2P( nGeoId, p3FrameStart - X_AX() * b3TopRef:getDimY() + Y_AX() * dBottomCPDelta , p3FrameEnd - Y_AX() * dTopCPDelta)
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, RIGHT)
end
end
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcFrameSolid( nProfileFrameLayerId, nGeoId, nFrameProfileLayerId, nGeoLayerId, nSolidLayerId)
-- ricavo tipo dal nome
local sName = EgtGetName( nGeoId)
local nProfileType = PRF.NULL
if sName == TOP then
nProfileType = PRF.TOP
elseif sName == BOTTOM then
nProfileType = PRF.BOTTOM
elseif sName == LEFT then
nProfileType = PRF.LEFT
elseif sName == RIGHT then
nProfileType = PRF.RIGHT
end
if nProfileType == PRF.TOP then
elseif nProfileType == PRF.BOTTOM then
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_BOTTOM)
-- creo copia
local nFrameProfileId = EgtCopy( nProfileId, nFrameProfileLayerId)
local b3FrameProfile = EgtGetBBox( nFrameProfileId, GDB_BB.STANDARD)
-- recupero posizione e BBox del geo
local b3Geo = EgtGetBBox(nGeoId, GDB_BB.STANDARD)
EgtMove( nFrameProfileId, b3Geo:getMin() + Z_AX() * b3Geo:getDimZ() - Point3d( b3FrameProfile:getMax():getX(), b3FrameProfile:getMin():getY(), b3Geo:getMax():getZ()))
EgtRotate( nFrameProfileId, b3Geo:getMin() + Z_AX() * b3Geo:getDimZ(), Y_AX(), -90)
-- recupero profilo outline e lo estrudo
local nFrameOutlineId = EgtGetFirstNameInGroup( nFrameProfileId, SECTION)
local nExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nFrameOutlineId, X_AX() * b3Geo:getDimX())
EgtInvertSurf( nExtrusionId)
-- copio e sposto profilo out left su start bottom per tagliarlo
local nOrigStartProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
local nStartProfileId = EgtCopy( nOrigStartProfileId, nFrameProfileLayerId)
EgtRotate( nStartProfileId, Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nStartProfileId, Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), Z_AX(), 90)
local b3StartProfileId = EgtGetBBoxGlob(nStartProfileId, GDB_BB.STANDARD)
EgtMove( nStartProfileId, b3Geo:getMin() - b3StartProfileId:getMin())
local nOutStartProfileId = EgtGetFirstNameInGroup( nStartProfileId, OUTOFST)
local nStartExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutStartProfileId, Y_AX() * b3FrameProfile:getDimY())
EgtInvertSurf( nStartExtrusionId)
local nExtrCopyId = EgtCopy( nExtrusionId, nSolidLayerId)
EgtSurfTmCut( nExtrusionId, nStartExtrusionId, true, false)
EgtSurfTmCut( nStartExtrusionId, nExtrCopyId, true, false)
--EgtErase( nExtrCopyId)
-- copio e sposto profilo out left su end bottom per tagliarlo
local nOrigEndProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
local nEndProfileId = EgtCopy( nOrigEndProfileId, nFrameProfileLayerId)
EgtRotate( nEndProfileId, Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), Y_AX(), -90)
EgtRotate( nEndProfileId, Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), Z_AX(), -90)
local b3EndProfileId = EgtGetBBoxGlob(nEndProfileId, GDB_BB.STANDARD)
EgtMove( nEndProfileId, Point3d( b3Geo:getMax():getX(),b3Geo:getMin():getY(),b3Geo:getMin():getZ()) - Point3d( b3EndProfileId:getMax():getX(), b3EndProfileId:getMin():getY(),b3EndProfileId:getMin():getZ()))
local nOutEndProfileId = EgtGetFirstNameInGroup( nEndProfileId, OUTOFST)
local nEndExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutEndProfileId, Y_AX() * b3FrameProfile:getDimY())
--EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
--local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
EgtSurfTmCut( nExtrusionId, nEndExtrusionId, true, false)
EgtSurfTmCut( nEndExtrusionId, nExtrCopyId, true, false)
EgtErase( nExtrCopyId)
elseif nProfileType == PRF.LEFT then
elseif nProfileType == PRF.RIGHT then
end
end
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtNewFile()
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, PROFILE)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- creo struttura layer del frame
local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nFrameLayerId, FRAME)
local nOutlineLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nOutlineLayerId, OUTLINE)
local nGeoLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nGeoLayerId, GEO)
local nSolidLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nSolidLayerId, SOLID)
local nFrameProfileLayerId = EgtGroup( nFrameLayerId)
EgtSetName( nFrameProfileLayerId, PROFILE)
-- disegno outline
local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0) )
EgtSetName( nFrameBottomId, BOTTOM)
local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0) )
EgtSetName( nFrameRightId, RIGHT)
local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0) )
EgtSetName( nFrameTopId, TOP)
local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0) )
EgtSetName( nFrameLeftId, LEFT)
-- scelgo tipo di giunzioni
-- per il momento faccio controprofili verticali
-- scelgo il tipo
-- per il momento faccio controprofili per anta
-- disegno ingombri frame
local nProfileFrameLayerId = EgtGetFirstNameInGroup( nProfileId, FRAME)
local nCurrOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nCurrOutlineId do
CalcFrameFootPrint( nProfileFrameLayerId, nCurrOutlineId, nGeoLayerId)
nCurrOutlineId = EgtGetNext( nCurrOutlineId)
end
-- posiziono profili
local nGeoId = EgtGetFirstInGroup( nGeoLayerId)
CalcFrameSolid(nProfileFrameLayerId, nGeoId, nFrameProfileLayerId, nGeoLayerId, nSolidLayerId)
---- bottom
--local nBottomProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_BOTTOM)
---- creo copia
--local nBottomFrameProfileId = EgtCopy( nBottomProfileId, nFrameProfileLayerId)
--local b3BottomFrameProfile = EgtGetBBox( nBottomFrameProfileId, GDB_BB.STANDARD)
---- recupero posizione e BBox del geo
--local nBottomGeoId = EgtGetFirstNameInGroup( nGeoId, BOTTOM)
--local b3BottomGeo = EgtGetBBox(nBottomGeoId, GDB_BB.STANDARD)
--EgtMove( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ() - Point3d( b3BottomFrameProfile:getMax():getX(), b3BottomFrameProfile:getMin():getY(), b3BottomGeo:getMax():getZ()))
--EgtRotate( nBottomFrameProfileId, b3BottomGeo:getMin() + Z_AX() * b3BottomGeo:getDimZ(), Y_AX(), -90)
---- recupero profilo outline e lo estrudo
--local nBottomFrameOutlineId = EgtGetFirstNameInGroup( nBottomFrameProfileId, SECTION)
--local nBottomExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nBottomFrameOutlineId, X_AX() * b3BottomGeo:getDimX())
--EgtInvertSurf( nBottomExtrusionId)
---- copio e sposto profilo out left su start bottom per tagliarlo
--local nLeftProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
--local nBottomOutLeftProfileId = EgtCopy( nLeftProfileId, nFrameProfileLayerId)
--EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
--EgtRotate( nBottomOutLeftProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), 90)
--local b3BottomOutLeftProfileId = EgtGetBBoxGlob(nBottomOutLeftProfileId, GDB_BB.STANDARD)
--EgtMove( nBottomOutLeftProfileId, b3BottomGeo:getMin() - b3BottomOutLeftProfileId:getMin())
--local nOutLeftProfileId = EgtGetFirstNameInGroup( nBottomOutLeftProfileId, OUTOFST)
--local nBottomOutLeftProfileExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutLeftProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
--EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
--local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
--EgtSurfTmCut( nBottomExtrusionId, nBottomOutLeftProfileExtrusionId, true, false)
--EgtSurfTmCut( nBottomOutLeftProfileExtrusionId, nExtrCopyId, true, false)
----EgtErase( nExtrCopyId)
---- copio e sposto profilo out left su end bottom per tagliarlo
--local nRightProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, SASH_TOP)
--local nBottomOutRightProfileId = EgtCopy( nRightProfileId, nFrameProfileLayerId)
--EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Y_AX(), -90)
--EgtRotate( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMin():getX(), b3BottomGeo:getMin():getY(), b3BottomGeo:getMax():getZ()), Z_AX(), -90)
--local b3BottomOutRightProfileId = EgtGetBBoxGlob(nBottomOutRightProfileId, GDB_BB.STANDARD)
--EgtMove( nBottomOutRightProfileId, Point3d( b3BottomGeo:getMax():getX(),b3BottomGeo:getMin():getY(),b3BottomGeo:getMin():getZ()) - Point3d( b3BottomOutRightProfileId:getMax():getX(), b3BottomOutRightProfileId:getMin():getY(),b3BottomOutRightProfileId:getMin():getZ()))
--local nOutRightProfileId = EgtGetFirstNameInGroup( nBottomOutRightProfileId, OUTOFST)
--local nBottomOutRightProfileExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutRightProfileId, Y_AX() * b3BottomFrameProfile:getDimY())
----EgtInvertSurf( nBottomOutLeftProfileExtrusionId)
----local nExtrCopyId = EgtCopy( nBottomExtrusionId, nSolidLayerId)
--EgtSurfTmCut( nBottomExtrusionId, nBottomOutRightProfileExtrusionId, true, false)
--EgtSurfTmCut( nBottomOutRightProfileExtrusionId, nExtrCopyId, true, false)
--EgtErase( nExtrCopyId)
-227
View File
@@ -1,227 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
--EgtEnableDebug( false)
-- Imposto direttorio per librerie
local sBaseDir = EgtGetSourceDir()
EgtOutLog("BaseDir=" .. sBaseDir)
EgtAddToPackagePath( sBaseDir .. '?.lua')
_G.package.loaded.WinConst = nil
require( 'WinConst')
_G.package.loaded.WinLib = nil
local WinLib = require( 'WinLib')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
local HoleWidth = 1835
local HoleHeight = 1516
local WindowWidth = 1800
local WindowHeight = 1500
local WindowTree
local sProfilePath = 'c:\\EgtData\\Window\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- funzioni
local function CreatePartFromArea( nAreaId)
-- creo pezzi outline
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE)
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nOutlineId do
WinLib.CreatePartFromOutline( nAreaId, nOutlineId)
nOutlineId = EgtGetNext( nOutlineId)
end
-- verifico se c'e' uno split
local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT)
if nSplitLayerId then
local nSplitId = EgtGetFirstInGroup( nSplitLayerId)
if nSplitId then
-- creo pezzo split
WinLib.CreatePartFromOutline( nAreaId, nSplitId)
end
end
-- verifico se ci sono aree
local nArea1Id = EgtGetFirstNameInGroup( nAreaId, WIN_AREA1)
if nArea1Id then
-- lancio costruzione pezzi di quell'area
CreatePartFromArea(nArea1Id)
end
local nArea2Id = EgtGetFirstNameInGroup( nAreaId, WIN_AREA1)
if nArea1Id then
-- lancio costruzione pezzi di quell'area
CreatePartFromArea(nArea1Id)
end
end
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtNewFile()
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, WIN_PROFILE)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- creo buco
local nHoleLayerId = WinLib.CreateHole( HoleWidth, HoleHeight)
-- creo frame come buco
WinLib.CreateFrameAsHole( nHoleLayerId, WIN_JNT.FULL_H)
local nSashId = WinLib.AddSash( nHoleLayerId)
local nFillId = WinLib.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- -- creo gruppo frame
-- local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
-- EgtSetName( nFrameLayerId, WIN_FRAME)
-- local nOutlineLayerId = EgtGroup( nFrameLayerId)
-- EgtSetName( nOutlineLayerId, WIN_OUTLINE)
-- -- disegno outline
-- local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
-- local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
-- EgtSetName( nFrameRightId, WIN_RIGHT)
-- local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0), Vector3d( -1, 0.5, 0))
-- EgtSetName( nFrameTopId, WIN_TOP)
-- local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
-- EgtSetName( nFrameLeftId, WIN_LEFT)
-- -- cerchio
-- local nFrameBottomId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
-- local nFrameRightId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
-- EgtSetName( nFrameRightId, WIN_RIGHT)
-- local nFrameTopId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0))
-- EgtSetName( nFrameTopId, WIN_TOP)
-- local nFrameLeftId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
-- EgtSetName( nFrameLeftId, WIN_LEFT)
-- -- disegno outline
-- local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
-- local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth+400, WindowHeight, 0))
-- EgtSetName( nFrameRightId, WIN_RIGHT)
-- local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( -200, WindowHeight-300, 0))
-- --local nFrameTopId = EgtArc2PV( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( -200, WindowHeight-300, 0), Vector3d( -1, 0.5, 0))
-- --local nFirstArcId = EgtArc2PDEx(nOutlineLayerId,{-200,1220,0},{0,1700,0},GDB_PT.STD,-1,90,GDB_RT.GRID) -- Id=369
-- --local nFrameTopId = EgtCurveCompo(nOutlineLayerId,nFirstArcId,true) -- Id=369
-- --local nSecondArcId = EgtArc2PDEx(nOutlineLayerId,{0,1700,0},{1700,1900,0},GDB_PT.STD,-1,44.7603,GDB_RT.GRID) -- Id=370
-- --EgtAddCurveCompoCurve(nFrameTopId,nSecondArcId,true,true) -- Ok=1
-- --local nThirdArcId = EgtArc2PDEx(nOutlineLayerId,{1700,1900,0},{1930,1520,0},GDB_PT.STD,199,328.6594,GDB_RT.GRID) -- Id=370
-- --EgtAddCurveCompoCurve(nFrameTopId,nThirdArcId,true,true) -- Ok=1
-- --EgtInvertCurve( nFrameTopId)
-- --local nFrameTop1Id = EgtLine( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( WindowWidth / 2, WindowHeight+100, 0))
-- --local nFrameTop2Id = EgtLine( nOutlineLayerId, Point3d( WindowWidth / 2, WindowHeight+100, 0), Point3d( -200, WindowHeight-300, 0))
-- --local nFrameTopId = EgtCurveCompo(nOutlineLayerId,nFrameTop1Id,true) -- Id=369
-- --EgtAddCurveCompoCurve(nFrameTopId,nFrameTop2Id,true,true) -- Ok=1
-- EgtSetName( nFrameTopId, WIN_TOP)
-- local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( -200, WindowHeight-300, 0), Point3d( 0, 0, 0))
-- EgtSetName( nFrameLeftId, WIN_LEFT)
-- -- scelgo tipo di giunzioni
-- local JointType = WIN_JNT.FULL_H
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_BL, JointType)
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_BR, JointType)
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_TL, JointType)
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_TR, JointType)
-- -- funzione che assegna i profili serramento ai vari outline
-- -- per il momento li assegno a mano
-- EgtSetInfo( nFrameBottomId, WIN_PROFILETYPE, WIN_SASH_BOTTOM)
-- EgtSetInfo( nFrameRightId, WIN_PROFILETYPE, WIN_SASH_TOP)
-- EgtSetInfo( nFrameTopId, WIN_PROFILETYPE, WIN_SASH_TOP)
-- EgtSetInfo( nFrameLeftId, WIN_PROFILETYPE, WIN_SASH_TOP)
-- -- definisco prima divisione
-- WinLib.AddSplit( nHoleLayerId, WIN_SPLITTYPE.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- WinLib.AddSplit( nFrameLayerId, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, 2, 3)
--WinLib.AddSplits( nFrameLayerId, WIN_SPLITTYPE.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 5, WindowWidth / 3 * 2})
--WinLib.AddSplits( nFrameLayerId, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, { 1.5, 3}, 4.5)
-- local nSplitId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight / 2, 0), Point3d( WindowWidth, WindowHeight / 4, 0))
-- local nArc1Id = EgtArc2PDEx( nOutlineLayerId, { 600, 1500, 0}, { 900, 800, 0}, GDB_PT.STD, -1, 270, GDB_RT.GRID) -- Id=301
-- local nSplitId = EgtCurveCompo( nOutlineLayerId, nArc1Id, true) -- Id=301
-- local nArc2Id = EgtArc2PDEx( nOutlineLayerId, { 900, 800, 0}, { 900, 0, 0}, GDB_PT.STD, -1, 316.3972, GDB_RT.GRID) -- Id=302
-- EgtAddCurveCompoCurve( nSplitId, nArc2Id, true, true) -- Ok=1
-- EgtInvertCurve( nSplitId)
-- WinLib.AddGenSplit( nFrameLayerId, nSplitId)
-- local nArea1Id = EgtGetFirstNameInGroup( nHoleLayerId, WIN_AREA1)
-- WinLib.AddSplit( nArea1Id, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, 2, 3)
-- creo pezzi per outline
-- local nCurrOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
-- while nCurrOutlineId do
-- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId)
-- nCurrOutlineId = EgtGetNext( nCurrOutlineId)
-- end
-- local nCurrOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_SPLIT)
-- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId)
-- creo tutti i pezzi
CreatePartFromArea( nHoleLayerId)
-- assemblo i pezzi
--WinLib.AssembleFrame()
EgtDraw()
-644
View File
@@ -1,644 +0,0 @@
--
-- EEEEEEEEEE GGGGGG WW WW WW
-- EEEEEEEEEE GGGGGGGGGG WW WW WW
-- EEEE GGGG GGGG WW WW WW
-- EEEE GGGG WWW WWWW WWW
-- EEEEEEE GGGG GGGGGGG WW WWWW WW
-- EEEEEEE GGGG GGGGGGG WWW WWWW WWW
-- EEEE GGGG GGGG WWWW WWWW
-- EEEE GGGG GGGG WWWW WWWW
-- EEEEEEEEEE GGGGGGGGGG WWW WWW
-- EEEEEEEEEE GGGGGG WW WW
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
-- EgtEnableDebug( false)
-- Imposto direttorio per librerie
local sBaseDir = EgtGetSourceDir()
EgtOutLog("BaseDir=" .. sBaseDir)
EgtAddToPackagePath( sBaseDir .. '?.lua')
EgtAddToPackagePath( sBaseDir .. 'WinLib\\' .. '?.lua')
_G.package.loaded.WinConst = nil
require( 'WinConst')
_G.package.loaded.WinCreate = nil
local WinCreate = require( 'WinCreate')
_G.package.loaded.WinCalculate = nil
local WinCalculate = require( 'WinCalculate')
_G.package.loaded.WinManageProject = nil
local WinManageProject = require( 'WinManageProject')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
local HoleWidth = 1835
local HoleHeight = 1516
local WindowWidth = 1800
local WindowHeight = 1500
local WindowTree
local sProfilePath = 'c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtStartCounter()
EgtNewFile()
-- importo profilo prescelto
WinCreate.ImportProfile( sProfilePath)
-- creo telaio rettangolare
local FrameJointType = WIN_JNT.FULL_H
local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointType, FrameJointType, FrameJointType, FrameJointType)
-- -- creo telaio generico
-- local nDrawFramePartId = EgtGroup( GDB_ID.ROOT)
-- EgtSetName( nDrawFramePartId, 'DrawFrame')
-- local nDrawFrameLayerId = EgtGroup( nDrawFramePartId)
-- local nFrameBottomId = EgtLine( nDrawFrameLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- local nFrameRightId = EgtLine( nDrawFrameLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
-- local nFrameTopId = EgtArc2PV( nDrawFrameLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0), Vector3d( 0, 1, 0))
-- --local nFrameTopId = EgtLine( nDrawFrameLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0))
-- local nFrameLeftId = EgtLine( nDrawFrameLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
-- local FrameJointType = WIN_JNT.ANGLED
-- local nFrameId = WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, FrameJointType, FrameJointType, FrameJointType, FrameJointType)
------------------------ Finestra vetro fisso ------------------------
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- aggiungo vetro
-- local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
------------------------ Finestra vetro fisso con divisione orizzontale ------------------------
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra vetro fisso con divisione verticale ------------------------
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra vetro fisso con divisione orizzontale e verticale ------------------------
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- definisco divisioni
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
-- ------------------------ Finestra anta singola ------------------------
-- aggiungo anta
local SashJointType = WIN_JNT.FULL_V
local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione orizzontale ------------------------
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione verticale ------------------------
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione orizzontale e verticale ------------------------
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco divisioni
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione custom ------------------------
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- local nTempSplitLayerId = EgtGroup( nFrameId)
-- EgtSetName( nTempSplitLayerId, WIN_TEMPSPLIT)
-- -- creo decoro
-- local nRectangleId = EgtRectangle2P( nTempSplitLayerId, Point3d( WindowWidth / 3, WindowHeight / 3, 0), Point3d( WindowWidth * 2 / 3, WindowHeight * 2 / 3, 0))
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nSashId, nRectangleId)
-- EgtErase( nTempSplitLayerId)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra doppia anta con montante verticale ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra doppia anta battente ricevente ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra doppia anta con montante orizzontale ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montanti verticali ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montante verticale e ante battente e ricevente ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montanti orizzontali ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
---------------------- Finestra tripla anta con montante orizzontale e verticale ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra sei ante con montanti verticali e orizzontale ------------------------
-- -- definisco divisione orizzontale
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- definisco divisioni verticali
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quarta anta
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quinta anta
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo sesta anta
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra sei ante con montante verticale e orizzontale ed ante battente ricevente ------------------------
-- -- definisco divisione orizzontale
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- definisco divisioni verticali
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quarta anta
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quinta anta
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo sesta anta
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tre ante con montante verticale, ante battente ricevente e split di tutte le ante ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco divisione
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- definisco divisione
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- definisco divisione
-- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill31Id = WinCreate.AddFill( nArea31Id, WIN_FILLTYPES.GLASS)
-- local nFill32Id = WinCreate.AddFill( nArea32Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tre ante con montante orizzontale e verticale, ante battente ricevente e split di tutte le ante ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo anta sopra
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash0Id = WinCreate.AddSash( nArea0Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetri
-- local nFill0Id = WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco divisione
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- definisco divisione
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- definisco divisione
-- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill31Id = WinCreate.AddFill( nArea31Id, WIN_FILLTYPES.GLASS)
-- local nFill32Id = WinCreate.AddFill( nArea32Id, WIN_FILLTYPES.GLASS)
-----------------------------------------------------------------------------------
-- -- creo gruppo frame
-- local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
-- EgtSetName( nFrameLayerId, WIN_FRAME)
-- local nOutlineLayerId = EgtGroup( nFrameLayerId)
-- EgtSetName( nOutlineLayerId, WIN_OUTLINE)
-- -- disegno outline
-- local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
-- local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
-- EgtSetName( nFrameRightId, WIN_RIGHT)
-- local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0), Vector3d( -1, 0.5, 0))
-- EgtSetName( nFrameTopId, WIN_TOP)
-- local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
-- EgtSetName( nFrameLeftId, WIN_LEFT)
-- -- cerchio
-- local nFrameBottomId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
-- local nFrameRightId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
-- EgtSetName( nFrameRightId, WIN_RIGHT)
-- local nFrameTopId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0))
-- EgtSetName( nFrameTopId, WIN_TOP)
-- local nFrameLeftId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
-- EgtSetName( nFrameLeftId, WIN_LEFT)
-- -- disegno outline
-- local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
-- local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth+400, WindowHeight, 0))
-- EgtSetName( nFrameRightId, WIN_RIGHT)
-- local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( -200, WindowHeight-300, 0))
-- --local nFrameTopId = EgtArc2PV( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( -200, WindowHeight-300, 0), Vector3d( -1, 0.5, 0))
-- --local nFirstArcId = EgtArc2PDEx(nOutlineLayerId,{-200,1220,0},{0,1700,0},GDB_PT.STD,-1,90,GDB_RT.GRID) -- Id=369
-- --local nFrameTopId = EgtCurveCompo(nOutlineLayerId,nFirstArcId,true) -- Id=369
-- --local nSecondArcId = EgtArc2PDEx(nOutlineLayerId,{0,1700,0},{1700,1900,0},GDB_PT.STD,-1,44.7603,GDB_RT.GRID) -- Id=370
-- --EgtAddCurveCompoCurve(nFrameTopId,nSecondArcId,true,true) -- Ok=1
-- --local nThirdArcId = EgtArc2PDEx(nOutlineLayerId,{1700,1900,0},{1930,1520,0},GDB_PT.STD,199,328.6594,GDB_RT.GRID) -- Id=370
-- --EgtAddCurveCompoCurve(nFrameTopId,nThirdArcId,true,true) -- Ok=1
-- --EgtInvertCurve( nFrameTopId)
-- --local nFrameTop1Id = EgtLine( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( WindowWidth / 2, WindowHeight+100, 0))
-- --local nFrameTop2Id = EgtLine( nOutlineLayerId, Point3d( WindowWidth / 2, WindowHeight+100, 0), Point3d( -200, WindowHeight-300, 0))
-- --local nFrameTopId = EgtCurveCompo(nOutlineLayerId,nFrameTop1Id,true) -- Id=369
-- --EgtAddCurveCompoCurve(nFrameTopId,nFrameTop2Id,true,true) -- Ok=1
-- EgtSetName( nFrameTopId, WIN_TOP)
-- local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( -200, WindowHeight-300, 0), Point3d( 0, 0, 0))
-- EgtSetName( nFrameLeftId, WIN_LEFT)
-- -- scelgo tipo di giunzioni
-- local JointType = WIN_JNT.FULL_H
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_BL, JointType)
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_BR, JointType)
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_TL, JointType)
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_TR, JointType)
-- -- funzione che assegna i profili serramento ai vari outline
-- -- per il momento li assegno a mano
-- EgtSetInfo( nFrameBottomId, WIN_PROFILETYPE, WIN_SASH_BOTTOM)
-- EgtSetInfo( nFrameRightId, WIN_PROFILETYPE, WIN_SASH_TOP)
-- EgtSetInfo( nFrameTopId, WIN_PROFILETYPE, WIN_SASH_TOP)
-- EgtSetInfo( nFrameLeftId, WIN_PROFILETYPE, WIN_SASH_TOP)
-- -- definisco prima divisione
-- WinLib.AddSplit( nHoleLayerId, WIN_SPLITTYPE.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- WinLib.AddSplit( nFrameLayerId, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, 2, 3)
--WinLib.AddSplits( nFrameLayerId, WIN_SPLITTYPE.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 5, WindowWidth / 3 * 2})
--WinLib.AddSplits( nFrameLayerId, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, { 1.5, 3}, 4.5)
-- local nSplitId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight / 2, 0), Point3d( WindowWidth, WindowHeight / 4, 0))
-- local nArc1Id = EgtArc2PDEx( nOutlineLayerId, { 600, 1500, 0}, { 900, 800, 0}, GDB_PT.STD, -1, 270, GDB_RT.GRID) -- Id=301
-- local nSplitId = EgtCurveCompo( nOutlineLayerId, nArc1Id, true) -- Id=301
-- local nArc2Id = EgtArc2PDEx( nOutlineLayerId, { 900, 800, 0}, { 900, 0, 0}, GDB_PT.STD, -1, 316.3972, GDB_RT.GRID) -- Id=302
-- EgtAddCurveCompoCurve( nSplitId, nArc2Id, true, true) -- Ok=1
-- EgtInvertCurve( nSplitId)
-- WinLib.AddGenSplit( nFrameLayerId, nSplitId)
-- local nArea1Id = EgtGetFirstNameInGroup( nHoleLayerId, WIN_AREA1)
-- WinLib.AddSplit( nArea1Id, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, 2, 3)
-- creo pezzi per outline
-- local nCurrOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
-- while nCurrOutlineId do
-- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId)
-- nCurrOutlineId = EgtGetNext( nCurrOutlineId)
-- end
-- local nCurrOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_SPLIT)
-- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId)
-- imposto se calcolare i solidi o meno
WinCalculate.SetCalcSolid( true)
-- -- creo i pezzi
WinCalculate.CreatePartFromArea( nFrameId)
-- -- creo tabella per salvataggio
-- local sSaveFilePath = 'c:\\Temp\\WindowTest1.txt'
-- local WinTable = WinManageProject.WriteToFile( nFrameId, sSaveFilePath)
-- assemblo i pezzi
--WinLib.AssembleFrame()
EgtZoom( SCE_ZM.ALL)
-- riporto tempi di esecuzione
local sOut = string.format( ' ExecTime = %.2f ms', EgtStopCounter())
EgtOutLog( sOut)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-223
View File
@@ -1,223 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinConst = {}
------------------------------------------- PARAMETERS -------------------------------------------
-- Tipi di giunzioni (joint)
WIN_JNT = {
ANGLED = 1,
FULL_H = 2,
FULL_V = 3,
}
-- tipo di giunzione pezzo
WIN_PART_JNT = {
ANGLED = 1,
FULL = 2,
SHORT = 3,
}
-- Tipi di profilo
WIN_PRF = {
NULL = 0,
TOP = 1,
BOTTOM = 2,
LEFT = 3,
RIGHT = 4,
VERTICAL = 5,
HORIZONTAL = 6,
SPLIT = 7,
BOTTOMRAIL = 8,
}
-- Tipi di split
WIN_SPLITORIENTATION = {
VERTICAL = 1,
HORIZONTAL = 2,
}
-- Tipi di misure
WIN_MEASURE = {
ABSOLUT = 1,
PROPORTIONAL = 2,
}
-- tipo di Area
WIN_AREATYPES = {
NULL = 0,
FRAME = 1,
SASH = 2,
FILL = 3,
SPLIT = 4,
}
-- tipo di split:
-- mullion = montante
-- french = battente / ricevente
WIN_SPLITTYPES = {
NULL = 0,
MULLION = 1,
FRENCH = 2,
}
-- tipi di riempimento interno
WIN_FILLTYPES = {
NULL = 0,
GLASS = 1,
WOOD = 2,
}
-- tipi di sash battente e ricevente
WIN_SASHTYPES = {
NULL = 0,
ACTIVE = 1,
INACTIVE = 2,
}
WIN_SURF_APPROX = 0.05
WIN_PROFILE = 'Profile'
WIN_PROFILEPATH = 'ProfilePath'
WIN_FRAME = 'Frame'
WIN_AREAOUTLINE = 'BaseOutline'
WIN_OUTLINE = 'Outline'
WIN_ORIGOUTLINE = 'OrigOutline'
WIN_GEO = 'Geo'
WIN_SOLID = 'Solid'
WIN_BOTTOM = 'Bottom'
WIN_RIGHT = 'Right'
WIN_TOP = 'Top'
WIN_LEFT = 'Left'
WIN_HORIZONTAL = 'Horizontal'
WIN_VERTICAL = 'Vertical'
WIN_BASESPLIT = 'BaseSplit'
WIN_TEMPSPLIT = 'TempSplit'
WIN_SPLIT = 'Split'
WIN_AREA = 'Area'
WIN_AREAASTERISK = 'Area*'
WIN_AREA1 = 'Area1'
WIN_AREA2 = 'Area2'
WIN_AREATYPE = 'AreaType'
WIN_SASH = 'Sash'
WIN_FILL = 'Fill'
WIN_FILLTYPE = 'FillType'
WIN_SIDE = 'Side'
WIN_SPLITTYPE = 'SplitType'
WIN_STARTJOINT = 'StartJoint'
WIN_ENDJOINT = 'EndJoint'
WIN_SASHTYPE = 'SashType'
WIN_REF_OUTLINE = 'OutlineRef'
WIN_REF_PART = 'PartRef'
WIN_SASH_TOP = 'Sash_Top'
WIN_SASH_BOTTOM = 'Sash_Bottom'
WIN_SASH_VERTICAL = 'Sash_Vertical'
WIN_SASH_HORIZONTAL = 'Sash_Horizontal'
WIN_RAIL_BOTTOM = 'Rail_Bottom'
WIN_FRAME_TOP = 'Frame_Top'
WIN_FRAME_BOTTOM = 'Frame_Bottom'
WIN_FIXED_TOP = 'Fixed_Top'
WIN_FIXED_BOTTOM = 'Fixed_Bottom'
WIN_SASH_ACTIVE = 'Sash_Active'
WIN_SASH_INACTIVE = 'Sash_Inactive'
WIN_SASH_SPLIT = 'Sash_Split'
WIN_FRAME_SPLIT = 'Frame_Split'
WIN_REF = 'Ref'
WIN_SECTION = 'Section'
WIN_STRIP = 'Strip'
WIN_ALU = 'Alu'
WIN_CTRIN = 'CtrIn'
WIN_OUT = 'Out'
WIN_OUTOFST = 'OfstOut'
WIN_CTRINOFST = 'OfstCtrIn'
WIN_OFST = 'Ofst'
WIN_SECTIONFRAME = 'SectionFrame'
WIN_MINIZINKEN = 'MiniZinken'
WIN_STARTCPDELTA = 'StartCPDelta'
WIN_ENDCPDELTA = 'EndCPDelta'
WIN_GEOWIDTH = 'GeoWidth'
WIN_GLASSTHICKNESS = 'GlassThickness'
WIN_GEOOUTLINEBOTTOM = 'GeoOutlineBottom'
WIN_JOINT_BL = 'JointBL'
WIN_JOINT_BR = 'JointBR'
WIN_JOINT_BDIV = 'JointBDiv'
WIN_JOINT_TL = 'JointTL'
WIN_JOINT_TR = 'JointTR'
WIN_JOINT_TDIV = 'JointTDiv'
WIN_GEO_IN = 'In'
WIN_GEO_OUT = 'Out'
WIN_GEO_LEFT = 'Left'
WIN_GEO_RIGHT = 'Right'
WIN_PRF_TYPE = 'Type'
WIN_PRF_MAIN = 'Main'
WIN_PRF_START = 'Start'
WIN_PRF_END = 'End'
WIN_PRF_SPLIT = 'Split'
WIN_PROFILETYPE = 'ProfileType'
WIN_SEPARATIONTYPE = 'SeparationType'
WIN_SPLIT_STARTINTERS = 'SplitStartInters'
WIN_SPLIT_ENDINTERS = 'SplitEndInters'
WIN_SOU = 'SOU'
WIN_CHILD = 'CHILD'
WIN_COPY = 'COPY'
WIN_OVERLAP = 'Overlap'
WIN_DELTA = 'Delta'
WIN_FILLOVERLAP = 'FillOverlap'
WIN_FILLDELTA = 'FillDelta'
WIN_MAINGUIDE = 'MainGuide'
WIN_STARTGUIDE = 'StartGuide'
WIN_ENDGUIDE = 'EndGuide'
WIN_SRF_MAIN = 'MainSurface'
WIN_SRF_ORIGMAIN = 'OrigMainSurface'
WIN_SRF_START = 'StartSurface'
WIN_SRF_END = 'EndSurface'
WIN_BOTTOMRAIL = 'BottomRail'
WIN_DOWEL = 'Dowel'
WIN_DWL_TOPPERPSTART = 'TopPerpStart'
WIN_DWL_TOPPERPEND = 'TopPerpEnd'
WIN_DWL_TOPPARASTART = 'TopParaStart'
WIN_DWL_TOPPARAEND = 'TopParaEnd'
WIN_DWL_BOTTOMPERPSTART = 'BottomPerpStart'
WIN_DWL_BOTTOMPERPEND = 'BottomPerpEnd'
WIN_DWL_BOTTOMPARASTART = 'BottomParaStart'
WIN_DWL_BOTTOMPARAEND = 'BottomParaEnd'
WIN_DWL_RAILBOTTOMPERPSTART = 'RailBottomPerpStart'
WIN_DWL_RAILBOTTOMPERPEND = 'RailBottomPerpEnd'
WIN_DWL_RAILBOTTOMPARASTART = 'RailBottomParaStart'
WIN_DWL_RAILBOTTOMPARAEND = 'RailBottomParaEnd'
WIN_DWL_SPLITPERPSTART = 'SplitPerpStart'
WIN_DWL_SPLITPERPEND = 'SplitPerpEnd'
---------------------------------------------------------------------
return WinConst
-54
View File
@@ -1,54 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinJWDConst = {}
------------------------------------------- PARAMETERS -------------------------------------------
-- tipi di sash battente e ricevente
-- WIN_SASHTYPES = {
-- NULL = 0,
-- ACTIVE = 1,
-- INACTIVE = 2,
-- }
JWD_EXT = '.jwd'
JWD_PROFILE_PATH = 'ProfilePath'
JWD_AREA = 'Area'
JWD_AREA_TYPE = 'AreaType'
JWD_JOINT_BL = 'JointBL'
JWD_JOINT_BR = 'JointBR'
JWD_JOINT_TL = 'JointTL'
JWD_JOINT_TR = 'JointTR'
JWD_OUTLINE = 'Outline'
JWD_JOINT = 'Joint'
JWD_SPLIT = 'Split'
JWD_CRV_TYPE = 'CurveType'
JWD_POINT_START = 'ptStart'
JWD_POINT_END = 'ptEnd'
JWD_POINT_MID = 'ptMid'
JWD_BOTTOM_RAIL = 'BottomRail'
JWD_SASH_TYPE = 'SashType'
JWD_FILL_TYPE = 'FillType'
---------------------------------------------------------------------
return WinJWDConst
-625
View File
@@ -1,625 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinLib = {}
-- Include
require( 'EgtBase')
_G.package.loaded.WinConst = nil
require( 'WinConst')
-- funzioni
-- funzione che crea un taglio split
function WinLib.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_OUTLINE)
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
-- recupero contorno
local OutlineIds = {}
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nOutlineId do
table.insert( OutlineIds, nOutlineId)
nOutlineId = EgtGetNext( nOutlineId)
end
if SplitType == WIN_SPLIT.VERTICAL then
-- creo linea
local nCalcPosition = 0
if MeasureType == WIN_MEASURE.ABSOLUT then
nCalcPosition = nPosition
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
nCalcPosition = b3OutlineLayer:getDimX() / nProportion * nPosition
end
local nTotSplitId = EgtLine( nOutlineLayerId, Point3d( nCalcPosition, 0, 0), Point3d( nCalcPosition, b3OutlineLayer:getDimY(), 0))
EgtSetName( nTotSplitId, WIN_VERTICAL)
-- la taglio con i contorni
local nCompoOutlineId = EgtCurveCompo( nOutlineLayerId, OutlineIds, false)
local nFROutlineId = EgtSurfFlatRegion( nOutlineLayerId, nCompoOutlineId)
local nSplitId, _ = EgtTrimCurveWithRegion( nTotSplitId, nFROutlineId, true, false)
EgtErase( { nCompoOutlineId, nFROutlineId})
elseif SplitType == WIN_SPLIT.HORIZONTAL then
local nFrameSplitId = EgtLine( nOutlineLayerId, Point3d( 0, nPosition, 0), Point3d( 0, nPosition, 0))
EgtSetName( nFrameSplitId, WIN_HORIZONTAL)
end
end
-- funzione che crea le aree da un taglio split
function WinLib.CreateAreaFromSplit( nOutlineLayerId, nFrameSplitId)
end
-- funzione che restituisce BBox del Ref del profilo
function WinLib.GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sProfileType)
local nProfileRefId = EgtGetFirstNameInGroup( nProfileId, WIN_REF)
local b3Ref = EgtGetBBox( nProfileRefId, GDB_BB.STANDARD)
return nProfileId, b3Ref
end
-- funzione che restituisce ref e calcola delta controprofilo dal profilo passatogli
function WinLib.GetDeltaProfile( nProfileFrameLayerId, sProfileType)
local nProfileId, b3Ref = WinLib.GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nCPId = EgtGetFirstNameInGroup( nProfileId, WIN_CTRIN)
local b3CP = EgtGetBBox( nCPId, GDB_BB.STANDARD)
local dCPDelta = b3Ref:getDimY() - b3CP:getDimY()
return dCPDelta, b3Ref
end
-- funzione che calcola l'ingombro dei pezzi del telaio
function WinLib.CalcFrameGeo( nPartId, nOutlineId)
-- recupero profilo
local nProfileLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local nProfileFrameLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_FRAME)
-- creo layer per ingombro
local nGeoLayerId = EgtGroup( nPartId)
EgtSetName( nGeoLayerId, WIN_GEO)
-- ricavo tipo dal nome
local sName = EgtGetName( nOutlineId)
local nProfileType = WIN_PRF.NULL
if sName == WIN_TOP then
nProfileType = WIN_PRF.TOP
elseif sName == WIN_BOTTOM then
nProfileType = WIN_PRF.BOTTOM
elseif sName == WIN_LEFT then
nProfileType = WIN_PRF.LEFT
elseif sName == WIN_RIGHT then
nProfileType = WIN_PRF.RIGHT
end
local nOutlineLayerId = EgtGetParent( nOutlineId)
local b3OutlineId = EgtGetBBoxGlob( nOutlineId, GDB_BB.STANDARD)
local nNewGeoId
if nProfileType == WIN_PRF.TOP then
-- recupero tipo di giunzioni
local StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
local EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = WinLib.GetDeltaProfile( nProfileFrameLayerId, WIN_SASH_TOP)
-- recupero outline precedente
local nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
local nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
-- calcolo vettori direzione
local vtNextOutline = EgtSV( nNextOutlineId)
local vtPrevOutline = EgtSV( nPrevOutlineId)
local vtCurrOutline = EgtSV( nOutlineId)
-- calcolo punti con inclinazione
local dSenNext = ( vtCurrOutline ^ vtNextOutline):getZ()
local dSenPrev = ( vtPrevOutline ^ vtCurrOutline):getZ()
local dCosNext = ( vtCurrOutline * vtNextOutline)
local dCosPrev = ( vtCurrOutline * vtPrevOutline)
local ptBL = ORIG()
local ptBR = ptBL + X_AX() * EgtCurveLength( nOutlineId) - X_AX() * dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) - X_AX() * dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_V, dTopCPDelta, 0)
local ptTR = ptBR + X_AX() * b3TopRef:getDimY() / dSenNext * dCosNext + Y_AX() * b3TopRef:getDimY()
local ptTL = ORIG() - X_AX() * b3TopRef:getDimY() / dSenPrev * dCosPrev + Y_AX() * b3TopRef:getDimY()
-- creo rettangolo ingombro
nNewGeoId = EgtCurveCompoFromPoints( nGeoLayerId, { ptBL, ptBR, ptTR, ptTL,ptBL})
EgtSetInfo( nNewGeoId, WIN_GEOOUTLINEBOTTOM, EgtCurveLength( nOutlineId) - dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) - dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_V, dTopCPDelta, 0))
--nNewGeoId = EgtRectangle2P( nGeoLayerId, ORIG(), ORIG() + X_AX() * b3OutlineId:getDimX() - X_AX() * EgtIf(StartJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) - X_AX() * EgtIf(EndJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) + Y_AX() * b3TopRef:getDimY())
if StartJointType == WIN_JNT.FULL_V then
EgtSetInfo( nNewGeoId, WIN_STARTCPDELTA, dTopCPDelta)
end
if EndJointType == WIN_JNT.FULL_V then
EgtSetInfo( nNewGeoId, WIN_ENDCPDELTA, dTopCPDelta)
end
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, WIN_TOP)
elseif nProfileType == WIN_PRF.BOTTOM then
-- recupero tipo di giunzioni
local StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
local EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = WinLib.GetDeltaProfile( nProfileFrameLayerId, WIN_SASH_TOP)
-- recupero ref del bottom
local _, b3BottomRef = WinLib.GetRefWithBBoxFromProfile( nProfileFrameLayerId, WIN_SASH_BOTTOM)
-- recupero outline precedente
local nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
local nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
-- calcolo vettori direzione
local vtNextOutline = EgtSV( nNextOutlineId)
local vtPrevOutline = EgtSV( nPrevOutlineId)
local vtCurrOutline = EgtSV( nOutlineId)
-- calcolo punti con inclinazione
local dSenNext = ( vtCurrOutline ^ vtNextOutline):getZ()
local dSenPrev = ( vtPrevOutline ^ vtCurrOutline):getZ()
local dCosNext = ( vtCurrOutline * vtNextOutline)
local dCosPrev = ( vtCurrOutline * vtPrevOutline)
local ptBL = ORIG()
local ptBR = ptBL + X_AX() * EgtCurveLength( nOutlineId) - X_AX() * dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) - X_AX() * dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_V, dTopCPDelta, 0)
local ptTR = ptBR + X_AX() * b3TopRef:getDimY() / dSenNext * dCosNext + Y_AX() * b3BottomRef:getDimY()
local ptTL = ORIG() - X_AX() * b3TopRef:getDimY() / dSenPrev * dCosPrev + Y_AX() * b3BottomRef:getDimY()
-- creo rettangolo ingombro
nNewGeoId = EgtCurveCompoFromPoints( nGeoLayerId, { ptBL, ptBR, ptTR, ptTL,ptBL})
EgtSetInfo( nNewGeoId, WIN_GEOOUTLINEBOTTOM, EgtCurveLength( nOutlineId) - dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) - dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_V, dTopCPDelta, 0))
--nNewGeoId = EgtRectangle2P( nGeoLayerId, ORIG(), ORIG() + X_AX() * b3OutlineId:getDimX() - X_AX() * EgtIf(StartJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) - X_AX() * EgtIf(EndJointType == WIN_JNT.FULL_V, dTopCPDelta, 0) + Y_AX() * b3BottomRef:getDimY())
if StartJointType == WIN_JNT.FULL_V then
EgtSetInfo( nNewGeoId, WIN_STARTCPDELTA, dTopCPDelta)
end
if EndJointType == WIN_JNT.FULL_V then
EgtSetInfo( nNewGeoId, WIN_ENDCPDELTA, dTopCPDelta)
end
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3BottomRef:getDimX())
EgtSetName( nNewGeoId, WIN_BOTTOM)
elseif nProfileType == WIN_PRF.LEFT then
-- recupero tipo di giunzioni
local StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
local EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = WinLib.GetDeltaProfile( nProfileFrameLayerId, WIN_SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = WinLib.GetDeltaProfile( nProfileFrameLayerId, WIN_SASH_BOTTOM)
-- recupero outline precedente
local nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
local nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
-- calcolo vettori direzione
local vtNextOutline = EgtSV( nNextOutlineId)
local vtPrevOutline = EgtSV( nPrevOutlineId)
local vtCurrOutline = EgtSV( nOutlineId)
-- calcolo punti con inclinazione
local dSenNext = ( vtCurrOutline ^ vtNextOutline):getZ()
local dSenPrev = ( vtPrevOutline ^ vtCurrOutline):getZ()
local dCosNext = ( vtCurrOutline * vtNextOutline)
local dCosPrev = ( vtCurrOutline * vtPrevOutline)
local ptBL = ORIG()
local ptBR = ptBL + X_AX() * EgtCurveLength( nOutlineId) - X_AX() * dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_H, dTopCPDelta, 0) - X_AX() * dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_H, dBottomCPDelta, 0)
local ptTR = ptBR + X_AX() * b3TopRef:getDimY() / dSenNext * dCosNext + Y_AX() * b3TopRef:getDimY()
local ptTL = ORIG() - X_AX() * b3TopRef:getDimY() / dSenPrev * dCosPrev + Y_AX() * b3TopRef:getDimY()
-- creo rettangolo ingombro
nNewGeoId = EgtCurveCompoFromPoints( nGeoLayerId, { ptBL, ptBR, ptTR, ptTL,ptBL})
EgtSetInfo( nNewGeoId, WIN_GEOOUTLINEBOTTOM, EgtCurveLength( nOutlineId) - dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_H, dTopCPDelta, 0) - dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_H, dBottomCPDelta, 0))
--nNewGeoId = EgtRectangle2P( nGeoLayerId, ORIG(), ORIG() + X_AX() * b3OutlineId:getDimY() - X_AX() * EgtIf(StartJointType == WIN_JNT.FULL_H, dTopCPDelta, 0) - X_AX() * EgtIf(EndJointType == WIN_JNT.FULL_H, dBottomCPDelta, 0) + Y_AX() * b3TopRef:getDimY())
if StartJointType == WIN_JNT.FULL_H then
EgtSetInfo( nNewGeoId, WIN_STARTCPDELTA, dTopCPDelta)
end
if EndJointType == WIN_JNT.FULL_H then
EgtSetInfo( nNewGeoId, WIN_ENDCPDELTA, dBottomCPDelta)
end
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, WIN_LEFT)
elseif nProfileType == WIN_PRF.RIGHT then
-- recupero tipo di giunzioni
local StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
local EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
-- recupero ref e controprofilo del top e calcolo delta
local dTopCPDelta, b3TopRef = WinLib.GetDeltaProfile( nProfileFrameLayerId, WIN_SASH_TOP)
-- recupero ref e controprofilo del bottom e calcolo delta
local dBottomCPDelta, b3BottomRef = WinLib.GetDeltaProfile( nProfileFrameLayerId, WIN_SASH_BOTTOM)
-- recupero outline precedente
local nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
local nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
-- calcolo vettori direzione
local vtNextOutline = EgtSV( nNextOutlineId)
local vtPrevOutline = EgtSV( nPrevOutlineId)
local vtCurrOutline = EgtSV( nOutlineId)
-- calcolo punti con inclinazione
local dSenNext = ( vtCurrOutline ^ vtNextOutline):getZ()
local dSenPrev = ( vtPrevOutline ^ vtCurrOutline):getZ()
local dCosNext = ( vtCurrOutline * vtNextOutline)
local dCosPrev = ( vtCurrOutline * vtPrevOutline)
local ptBL = ORIG()
local ptBR = ptBL + X_AX() * EgtCurveLength( nOutlineId) - X_AX() * dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_H, dBottomCPDelta, 0) - X_AX() * dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_H, dTopCPDelta, 0)
local ptTR = ptBR + X_AX() * b3TopRef:getDimY() / dSenNext * dCosNext + Y_AX() * b3TopRef:getDimY()
local ptTL = ORIG() - X_AX() * b3TopRef:getDimY() / dSenPrev * dCosPrev + Y_AX() * b3TopRef:getDimY()
-- creo rettangolo ingombro
nNewGeoId = EgtCurveCompoFromPoints( nGeoLayerId, { ptBL, ptBR, ptTR, ptTL,ptBL})
EgtSetInfo( nNewGeoId, WIN_GEOOUTLINEBOTTOM, EgtCurveLength( nOutlineId) - dSenPrev * EgtIf(StartJointType == WIN_JNT.FULL_H, dBottomCPDelta, 0) - dSenNext * EgtIf(EndJointType == WIN_JNT.FULL_H, dTopCPDelta, 0))
--nNewGeoId = EgtRectangle2P( nGeoLayerId, ORIG(), ORIG() + X_AX() * b3OutlineId:getDimY() - X_AX() * EgtIf(StartJointType == WIN_JNT.FULL_H, dBottomCPDelta, 0) - X_AX() * EgtIf(EndJointType == WIN_JNT.FULL_H, dTopCPDelta, 0) + Y_AX() * b3TopRef:getDimY())
if StartJointType == WIN_JNT.FULL_H then
EgtSetInfo( nNewGeoId, WIN_STARTCPDELTA, dBottomCPDelta)
end
if EndJointType == WIN_JNT.FULL_H then
EgtSetInfo( nNewGeoId, WIN_ENDCPDELTA, dTopCPDelta)
end
EgtModifyCurveExtrusion( nNewGeoId, Z_AX())
EgtModifyCurveThickness( nNewGeoId, -b3TopRef:getDimX())
EgtSetName( nNewGeoId, WIN_RIGHT)
end
return nNewGeoId
end
-- funzione che posiziona i profili, li estrude e crea il solido
function WinLib.CalcStartEndProfileType(nProfileType)
local StartJointType
local EndJointType
local nFrameLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_FRAME)
local nOutlineLayerId = EgtGetFirstNameInGroup( nFrameLayerId, WIN_OUTLINE)
local sStartProfileType
local sEndProfileType
if nProfileType == WIN_PRF.BOTTOM then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.ANGLED then
--sStartProfileType = WIN_OUTOFST
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.ANGLED then
--sEndProfileType = WIN_OUTOFST
end
elseif nProfileType == WIN_PRF.RIGHT then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.ANGLED then
--sStartProfileType = WIN_OUTOFST
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.ANGLED then
--sEndProfileType = WIN_OUTOFST
end
elseif nProfileType == WIN_PRF.TOP then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.ANGLED then
--sStartProfileType = WIN_OUTOFST
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.ANGLED then
--sEndProfileType = WIN_OUTOFST
end
elseif nProfileType == WIN_PRF.LEFT then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.ANGLED then
--sStartProfileType = WIN_OUTOFST
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.ANGLED then
--sEndProfileType = WIN_OUTOFST
end
end
return sStartProfileType, sEndProfileType, StartJointType, EndJointType
end
-- funzione che posiziona i profili, li estrude e crea il solido
function WinLib.MakeSolidByExtrusion(nGeoId, nMainProfileId, nStartProfileId, nEndProfileId, nProfileType, nSolidLayerId)
-- recupero outline
local nPartId = EgtGetParent( nSolidLayerId)
local nAreaId = EgtGetInfo( nPartId, WIN_AREA)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE)
local sOutlineName = ''
local sPrevOutlineName = ''
local sNextOutlineName = ''
if nProfileType == WIN_PRF.BOTTOM then
sOutlineName = WIN_BOTTOM
sPrevOutlineName = WIN_LEFT
sNextOutlineName = WIN_RIGHT
elseif nProfileType == WIN_PRF.RIGHT then
sOutlineName = WIN_RIGHT
sPrevOutlineName = WIN_BOTTOM
sNextOutlineName = WIN_TOP
elseif nProfileType == WIN_PRF.TOP then
sOutlineName = WIN_TOP
sPrevOutlineName = WIN_RIGHT
sNextOutlineName = WIN_LEFT
elseif nProfileType == WIN_PRF.LEFT then
sOutlineName = WIN_LEFT
sPrevOutlineName = WIN_TOP
sNextOutlineName = WIN_BOTTOM
end
local nOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sOutlineName)
local nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sPrevOutlineName)
local nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sNextOutlineName)
-- calcolo vettori direzione degli outline
local vtNextOutline = EgtSV( nNextOutlineId)
local vtCurrOutline = EgtSV( nOutlineId)
local vtPrevOutline = EgtSV( nPrevOutlineId)
-- recupero posizione e BBox del geo
local b3Geo = EgtGetBBox(nGeoId, GDB_BB.STANDARD)
-- recupero BBox del profilo Main
local nRefMainProfileId = EgtGetFirstNameInGroup( nMainProfileId, WIN_REF)
local b3RefMainProfile = EgtGetBBoxGlob( nRefMainProfileId, GDB_BB.STANDARD)
-- recupero frame del profilo
local nMainProfileFrameId = EgtGetFirstNameInGroup( nMainProfileId, WIN_SECTIONFRAME)
local frInvertMainProfile = EgtFR( nMainProfileFrameId)
frInvertMainProfile:invert()
-- lo applico a tutte le geometrie del profilo
EgtTransform( EgtGetAllInGroup( nMainProfileId), frInvertMainProfile)
-- assegno come riferimento del profilo il punto start dell'outline
EgtChangeGroupFrame( nMainProfileId, Frame3d( Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), - X_AX()))
-- recupero outline del profilo Main e lo estrudo
local nMainOutlineId = EgtGetFirstNameInGroup( nMainProfileId, WIN_SECTION)
if nProfileType == WIN_PRF.BOTTOM then
EgtInvertCurve( nMainOutlineId)
end
local nMainExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nMainOutlineId, X_AX() * b3Geo:getDimX())
-- posiziono il profilo Start
local nRefStartProfileId = EgtGetFirstNameInGroup( nStartProfileId, WIN_REF)
local b3RefStartProfile = EgtGetBBoxGlob(nRefStartProfileId, GDB_BB.STANDARD)
local dDelta = EgtGetInfo( nGeoId, WIN_STARTCPDELTA, 'd') or 0
-- recupero frame del profilo
local nStartProfileFrameId = EgtGetFirstNameInGroup( nStartProfileId, WIN_SECTIONFRAME)
local frInvertStartProfile = EgtFR( nStartProfileFrameId)
frInvertStartProfile:move( - Y_AX() * dDelta)
frInvertStartProfile:invert()
-- lo applico a tutte le geometrie del profilo
EgtTransform( EgtGetAllInGroup( nStartProfileId), frInvertStartProfile)
-- assegno come riferimento del profilo il punto start dell'outline
--do return end
EgtChangeGroupFrame( nStartProfileId, Frame3d( ORIG(), - vtPrevOutline))
local dSenNext = ( vtCurrOutline ^ vtNextOutline):getZ()
local dSenPrev = ( vtPrevOutline ^ vtCurrOutline):getZ()
local dCosNext = ( vtCurrOutline * vtNextOutline)
local dCosPrev = ( vtCurrOutline * vtPrevOutline)
local dDeltaStartAngle = b3RefStartProfile:getDimX() * dCosPrev / dSenPrev
EgtMove( nStartProfileId, vtPrevOutline * dDeltaStartAngle)
-- in base al tipo di incastro e di pezzo, ricavo i controprofili
local sStartProfileType
local sEndProfileType
-- recupero tipo di giunzioni
sStartProfileType, sEndProfileType, StartJointType, EndJointType = WinLib.CalcStartEndProfileType( nProfileType)
-- recupero outline del profilo Start e lo estrudo
local nOutStartProfileId = EgtGetFirstNameInGroup( nStartProfileId, sStartProfileType)
--if (StartJointType == WIN_JNT.FULL_H and ( nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP or nProfileType == WIN_PRF.RIGHT)) or
-- (StartJointType == WIN_JNT.FULL_V and ( nProfileType == WIN_PRF.LEFT)) then
-- EgtInvertCurve( nOutStartProfileId)
--end
if StartJointType == WIN_JNT.FULL_H and nProfileType == WIN_PRF.BOTTOM then
EgtInvertCurve( nOutStartProfileId)
end
local nStartExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutStartProfileId, - vtPrevOutline * ( b3RefMainProfile:getDimY() / dSenPrev + dDeltaStartAngle))
-- taglio estrusi per ottenere solido
local nExtrCopyId = EgtCopy( nMainExtrusionId, nSolidLayerId)
EgtSurfTmCut( nMainExtrusionId, nStartExtrusionId, true, false)
EgtSurfTmCut( nStartExtrusionId, nExtrCopyId, true, false)
-- posiziono il profilo End
--EgtRotate( EgtGetAllInGroup( nEndProfileId), ORIG(), Z_AX(), 90)
--EgtRotate( EgtGetAllInGroup( nEndProfileId), ORIG(), Y_AX(), 180)
local nRefEndProfileId = EgtGetFirstNameInGroup( nEndProfileId, WIN_REF)
local b3RefEndProfile = EgtGetBBoxGlob(nRefEndProfileId, GDB_BB.STANDARD)
local dDelta = EgtGetInfo( nGeoId, WIN_ENDCPDELTA, 'd') or 0
--vtMove = vtMove - X_AX() * dDelta
--EgtMove( nStartProfileId, vtMove)
--EgtMove( EgtGetAllInGroup( nEndProfileId), ORIG() - Point3d( b3RefEndProfile:getMax():getX(), b3RefEndProfile:getMax():getY(), b3RefEndProfile:getMax():getZ()) + X_AX() * dDelta, GDB_RT.GLOB)
-- recupero frame del profilo
local nEndProfileFrameId = EgtGetFirstNameInGroup( nEndProfileId, WIN_SECTIONFRAME)
local frInvertEndProfile = EgtFR( nEndProfileFrameId)
frInvertEndProfile:move( - Y_AX() * dDelta)
EgtMove(nEndProfileFrameId, - Y_AX() * dDelta)
frInvertEndProfile:invert()
-- lo applico a tutte le geometrie del profilo
EgtTransform( EgtGetAllInGroup( nEndProfileId), frInvertEndProfile)
-- assegno come riferimento del profilo il punto start dell'outline
local b3Outline = EgtGetBBox( nOutlineId, GDB_BB.STANDARD)
local dBottomOutline = EgtGetInfo( nGeoId, WIN_GEOOUTLINEBOTTOM, 'd')
EgtChangeGroupFrame( nEndProfileId, Frame3d( ORIG() + X_AX() * dBottomOutline , - vtNextOutline))
--EgtChangeGroupFrame( nEndProfileId, Frame3d( Point3d( b3Outline:getMax():getX(), b3Outline:getMin():getY(), b3Outline:getMax():getZ()), - vtNextOutline))
local dDeltaEndAngle = b3RefEndProfile:getDimX() * dCosNext / dSenNext
EgtMove( nEndProfileId, - vtNextOutline * dDeltaEndAngle)
--EgtRotate( nEndProfileId, Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), Y_AX(), -90)
--local dSecondAngle = EgtIf( nProfileType == WIN_PRF.LEFT, 90, -90)
--EgtRotate( nEndProfileId, Point3d( b3Geo:getMin():getX(), b3Geo:getMin():getY(), b3Geo:getMax():getZ()), Z_AX(), dSecondAngle)
--local nRefEndProfileId = EgtGetFirstNameInGroup( nEndProfileId, WIN_REF)
--local b3RefEndProfile = EgtGetBBoxGlob(nRefEndProfileId, GDB_BB.STANDARD)
--local vtMove = Point3d( b3Geo:getMax():getX(),b3Geo:getMin():getY(),b3Geo:getMin():getZ()) - Point3d( b3RefEndProfile:getMax():getX(), b3RefEndProfile:getMin():getY(), b3RefEndProfile:getMin():getZ())
---- sposto del delta controprofilo se necessario
--local dDelta = EgtGetInfo( nGeoId, WIN_ENDCPDELTA, 'd') or 0
--vtMove = vtMove + X_AX() * dDelta
--EgtMove( nEndProfileId, vtMove)
-- recupero outline del profilo End e lo estrudo
local nOutEndProfileId = EgtGetFirstNameInGroup( nEndProfileId, sEndProfileType)
if (EndJointType == WIN_JNT.FULL_H and nProfileType == WIN_PRF.RIGHT) or
(EndJointType == WIN_JNT.FULL_V and (nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP or nProfileType == WIN_PRF.LEFT)) then
EgtInvertCurve( nOutEndProfileId)
end
local nEndExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nOutEndProfileId, vtNextOutline * ( b3RefMainProfile:getDimY() / dSenNext + dDeltaEndAngle))
-- taglio estrusi per ottenere solido
EgtSurfTmCut( nMainExtrusionId, nEndExtrusionId, true, false)
EgtSurfTmCut( nEndExtrusionId, nExtrCopyId, true, false)
EgtErase( nExtrCopyId)
end
-- funzione che crea il solido del pezzo del telaio
function WinLib.CalcFrameSolid(nPartId, nGeoId)
-- recupero profilo
local nProfileId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local nProfileFrameLayerId = EgtGetFirstNameInGroup( nProfileId, WIN_FRAME)
-- creo layer per solido e per profili di estrusione
local nSolidLayerId = EgtGroup( nPartId)
EgtSetName( nSolidLayerId, WIN_SOLID)
local nFrameProfileLayerId = EgtGroup( nPartId)
EgtSetName( nFrameProfileLayerId, WIN_PROFILE)
-- ricavo tipo dal nome
local sName = EgtGetName( nGeoId)
local nProfileType = WIN_PRF.NULL
if sName == WIN_TOP then
nProfileType = WIN_PRF.TOP
elseif sName == WIN_BOTTOM then
nProfileType = WIN_PRF.BOTTOM
elseif sName == WIN_LEFT then
nProfileType = WIN_PRF.LEFT
elseif sName == WIN_RIGHT then
nProfileType = WIN_PRF.RIGHT
end
local nOrigMainProfileId = GDB_ID.NULL
local nMainProfileId = GDB_ID.NULL
local nOrigStartProfileId = GDB_ID.NULL
local nStartProfileId = GDB_ID.NULL
local nOrigEndProfileId = GDB_ID.NULL
local nEndProfileId = GDB_ID.NULL
-- recupero profilo e controprofili per tipo
if nProfileType == WIN_PRF.BOTTOM then
nOrigMainProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_BOTTOM)
nOrigStartProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
nOrigEndProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
elseif nProfileType == WIN_PRF.RIGHT then
nOrigMainProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
nOrigStartProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_BOTTOM)
nOrigEndProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
elseif nProfileType == WIN_PRF.TOP then
nOrigMainProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
nOrigStartProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
nOrigEndProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
elseif nProfileType == WIN_PRF.LEFT then
nOrigMainProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
nOrigStartProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_TOP)
nOrigEndProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, WIN_SASH_BOTTOM)
end
-- creo copie di profilo e controprofili
nMainProfileId = EgtCopy( nOrigMainProfileId, nFrameProfileLayerId)
nStartProfileId = EgtCopy( nOrigStartProfileId, nFrameProfileLayerId)
nEndProfileId = EgtCopy( nOrigEndProfileId, nFrameProfileLayerId)
-- creo solido dai profili
WinLib.MakeSolidByExtrusion(nGeoId, nMainProfileId, nStartProfileId, nEndProfileId, nProfileType, nSolidLayerId)
end
-- funzione che calcola l'ingombro dei pezzi del telaio
function WinLib.CreatePartFromOutline( nFrameLayerId, nOutlineId)
-- ricavo tipo dal nome
local sName = EgtGetName( nOutlineId)
local nProfileType = WIN_PRF.NULL
if sName == WIN_TOP then
nProfileType = WIN_PRF.TOP
elseif sName == WIN_BOTTOM then
nProfileType = WIN_PRF.BOTTOM
elseif sName == WIN_LEFT then
nProfileType = WIN_PRF.LEFT
elseif sName == WIN_RIGHT then
nProfileType = WIN_PRF.RIGHT
end
-- creo pezzo
local nPartId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nPartId, sName)
if nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP then
EgtSetColor( nPartId, Color3d( 204, 102, 0))
elseif nProfileType == WIN_PRF.RIGHT or nProfileType == WIN_PRF.LEFT then
EgtSetColor( nPartId, Color3d( 251, 128, 4))
end
-- inserisco riferimento alla sua area
EgtSetInfo( nPartId, WIN_AREA, nFrameLayerId)
-- disegno ingombro
local nGeoId = WinLib.CalcFrameGeo( nPartId, nOutlineId)
-- disegno solido
WinLib.CalcFrameSolid(nPartId, nGeoId)
-- offset per distanziare i pezzi
local dYPosOffset = 300 * ( nProfileType - 1)
EgtChangeGroupFrame( nPartId, Frame3d( Point3d( 0, dYPosOffset, 0)))
end
-- funzione che posiziona un pezzo
function WinLib.PositionPart(nPartId)
-- ricavo tipo dal nome
local sName = EgtGetName( nPartId)
local sDelta = ''
if sName == WIN_BOTTOM then
sDelta = WIN_STARTCPDELTA
elseif sName == WIN_RIGHT then
sDelta = WIN_STARTCPDELTA
elseif sName == WIN_TOP then
sDelta = WIN_STARTCPDELTA
elseif sName == WIN_LEFT then
sDelta = WIN_STARTCPDELTA
end
-- calcolo nuovo riferimento
local nGeoPartLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
local nGeoPartId = EgtGetFirstNameInGroup( nGeoPartLayerId, sName)
local dDelta = EgtGetInfo( nGeoPartId, sDelta, 'd') or 0
local nFrameLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_FRAME)
local nOutlineLayerId = EgtGetFirstNameInGroup( nFrameLayerId, WIN_OUTLINE)
local nFramePartId = EgtGetFirstNameInGroup( nOutlineLayerId, sName)
local vtStart = EgtSV( nFramePartId)
local ptStart = EgtSP( nFramePartId) + vtStart * dDelta
local _, _, dAngRight = SphericalFromVector(vtStart)
local frStart = Frame3d( ptStart)
frStart:rotate( frStart:getOrigin(), Z_AX(), dAngRight)
EgtChangeGroupFrame( nPartId, frStart)
end
-- funzione che assembla i pezzi
function WinLib.AssembleFrame()
local nBottomPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_BOTTOM)
WinLib.PositionPart(nBottomPartId)
local nRightPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_RIGHT)
WinLib.PositionPart(nRightPartId)
local nTopPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_TOP)
WinLib.PositionPart(nTopPartId)
local nLeftPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_LEFT)
WinLib.PositionPart(nLeftPartId)
-- assemblo i pezzi
--local nRightPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_RIGHT)
--local nGeoRightLayerId = EgtGetFirstNameInGroup( nRightPartId, WIN_GEO)
--local nGeoRightId = EgtGetFirstNameInGroup( nGeoRightLayerId, WIN_RIGHT)
--local dDelta = EgtGetInfo( nGeoRightId, WIN_BOTTOMCPDELTA, 'd')
--local nFrameLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_FRAME)
--local nOutlineLayerId = EgtGetFirstNameInGroup( nFrameLayerId, WIN_OUTLINE)
--local nFrameRightId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
--local vtRight = EgtSV( nFrameRightId)
--local ptRight = EgtSP( nFrameRightId) + vtRight * dDelta
--local _, _, dAngRight = SphericalFromVector(vtRight)
--local frRight = Frame3d( ptRight)
--frRight:rotate( frRight:getOrigin(), Z_AX(), dAngRight)
--EgtChangeGroupFrame( nRightPartId, frRight)
end
---------------------------------------------------------------------
return WinLib
-958
View File
@@ -1,958 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinLib = {}
-- Include
require( 'EgtBase')
_G.package.loaded.WinConst = nil
require( 'WinConst')
-- funzioni
-- funzione che crea il buco per la finestra
function WinLib.CreateHole( dWidth, dHeight)
-- creo gruppo per buco
local nAreaLayerId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nAreaLayerId, WIN_FRAME)
local nAreaOutlineLayerId = EgtGroup( nAreaLayerId)
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
-- disegno outline
local nHoleBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
EgtSetName( nHoleBottomId, WIN_BOTTOM)
local nHoleRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
EgtSetName( nHoleRightId, WIN_RIGHT)
local nHoleTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
EgtSetName( nHoleTopId, WIN_TOP)
local nHoleLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
EgtSetName( nHoleLeftId, WIN_LEFT)
return nAreaLayerId
end
-- funzione che crea il telaio a partire dal buco
function WinLib.CreateFrameOnHole( nHoleLayerId, dWidth, dHeight)
local nAreaOutlineLayerId = EgtGroup( nHoleLayerId)
EgtSetName( nAreaOutlineLayerId, WIN_OUTLINE)
-- disegno outline
local nHoleBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
EgtSetName( nHoleBottomId, WIN_BOTTOM)
local nHoleRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
EgtSetName( nHoleRightId, WIN_RIGHT)
local nHoleTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
EgtSetName( nHoleTopId, WIN_TOP)
local nHoleLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
EgtSetName( nHoleLeftId, WIN_LEFT)
end
-- funzione che crea il telaio a partire dal buco
function WinLib.CreateFrameAsHole( nAreaLayerId, JointType)
-- creo layer outline del frame
local nOutlineLayerId = EgtGroup( nAreaLayerId)
EgtSetName( nOutlineLayerId, WIN_OUTLINE)
-- recupero outline del buco
local nAreaOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
-- lo copio
local nHoleOutlineId = EgtGetFirstInGroup( nAreaOutlineLayerId)
while nHoleOutlineId do
local nOutlineId = EgtCopy( nHoleOutlineId, nOutlineLayerId)
-- da modificare!!!
-- funzione che assegna i profili serramento ai vari outline
local sName = EgtGetName( nHoleOutlineId)
if sName == WIN_BOTTOM then
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_BOTTOM)
elseif sName == WIN_RIGHT then
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP)
elseif sName == WIN_TOP then
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP)
elseif sName == WIN_LEFT then
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP)
end
nHoleOutlineId = EgtGetNext( nHoleOutlineId)
end
EgtSetInfo( nOutlineLayerId, WIN_JOINT_BL, JointType)
EgtSetInfo( nOutlineLayerId, WIN_JOINT_BR, JointType)
EgtSetInfo( nOutlineLayerId, WIN_JOINT_TL, JointType)
EgtSetInfo( nOutlineLayerId, WIN_JOINT_TR, JointType)
end
-- funzione che aggiunge una anta
function WinLib.AddSash( nAreaId)
-- creo nuova area
local nSashAreaId = EgtGroup( nAreaId)
EgtSetName( nSashAreaId, WIN_SASH)
EgtSetInfo( nSashAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH)
-- recupero outline area precedente
local nPrevAreaOutlineId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
-- lo copio per outline area dell'anta
local nAreaOutlineId = EgtCopy( nPrevAreaOutlineId, nSashAreaId)
return nSashAreaId
end
-- funzione che aggiunge un riempimento
function WinLib.AddFill( nAreaId, FillType)
-- creo nuova area
local nFillAreaId = EgtGroup( nAreaId)
EgtSetName( nFillAreaId, WIN_FILL)
EgtSetInfo( nFillAreaId, WIN_AREATYPE, WIN_AREATYPES.FILL)
-- recupero outline area precedente
local nPrevAreaOutlineId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
-- lo copio per outline area dell'anta
local nAreaOutlineId = EgtCopy( nPrevAreaOutlineId, nFillAreaId)
-- imposto tipo di fill
EgtSetInfo( nFillAreaId, WIN_FILLTYPE, FillType)
return nFillAreaId
end
-- funzione che restituisce un outline dato un pezzo
function WinLib.GetOutlineFromPart( nPartId)
local nAreaId = EgtGetInfo( nPartId, WIN_AREA)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE)
local sName = EgtGetName( nPartId)
return EgtGetFirstNameInGroup( nOutlineLayerId, sName)
end
-- funzione che crea un taglio split
function WinLib.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion)
-- creo layer per split
local nSplitLayerId = EgtGroup( nAreaLayerId)
EgtSetName( nSplitLayerId, WIN_SPLIT)
-- recupero contorno area precedente
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
local OutlineIds = {}
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nOutlineId do
local sName = EgtGetName( nOutlineId)
table.insert( OutlineIds, nOutlineId)
nOutlineId = EgtGetNext( nOutlineId)
end
local nSplitId
if SplitType == WIN_SPLITTYPE.VERTICAL then
-- creo linea
local nCalcPosition = 0
if MeasureType == WIN_MEASURE.ABSOLUT then
nCalcPosition = nPosition
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
nCalcPosition = b3OutlineLayer:getDimX() / nProportion * nPosition
end
local nTotSplitId = EgtLine( nSplitLayerId, Point3d( nCalcPosition, 0, 0), Point3d( nCalcPosition, b3OutlineLayer:getDimY(), 0))
-- la taglio con i contorni
local nCompoOutlineId = EgtCurveCompo( nSplitLayerId, OutlineIds, false)
local nFROutlineId = EgtSurfFlatRegion( nSplitLayerId, nCompoOutlineId)
nSplitId = EgtTrimCurveWithRegion( nTotSplitId, nFROutlineId, true, false)
EgtSetName( nSplitId, WIN_VERTICAL)
EgtErase( { nCompoOutlineId, nFROutlineId})
EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_VERTICAL)
elseif SplitType == WIN_SPLITTYPE.HORIZONTAL then
-- creo linea
local nCalcPosition = 0
if MeasureType == WIN_MEASURE.ABSOLUT then
nCalcPosition = nPosition
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
nCalcPosition = b3OutlineLayer:getDimY() / nProportion * nPosition
end
local nTotSplitId = EgtLine( nSplitLayerId, Point3d( 0, nCalcPosition, 0), Point3d( b3OutlineLayer:getDimX(), nCalcPosition, 0))
-- la taglio con i contorni
local nCompoOutlineId = EgtCurveCompo( nSplitLayerId, OutlineIds, false)
local nFROutlineId = EgtSurfFlatRegion( nSplitLayerId, nCompoOutlineId)
nSplitId = EgtTrimCurveWithRegion( nTotSplitId, nFROutlineId, true, false)
EgtSetName( nSplitId, WIN_HORIZONTAL)
EgtErase( { nCompoOutlineId, nFROutlineId})
EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_HORIZONTAL)
end
-- creo aree
WinLib.CreateAreaFromSplit( nAreaLayerId, nSplitId)
end
-- funzione che crea tagli split multipli
function WinLib.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList, nProportion)
if MeasureType == WIN_MEASURE.ABSOLUT then
for nIndex = 1, #PositionList do
WinLib.AddSplit( nAreaLayerId, SplitType, MeasureType, PositionList[nIndex], nProportion)
end
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
for nIndex = 1, #PositionList do
WinLib.AddSplit( nAreaLayerId, SplitType, MeasureType, PositionList[nIndex], nProportion)
end
end
end
-- funzione che crea un taglio split da una curva generica
function WinLib.AddGenSplit( nAreaLayerId, nSplitId)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_OUTLINE)
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
-- allungo curva split per cercare intersezioni
EgtExtendCurveStartByLen( nSplitId, 10)
EgtExtendCurveEndByLen( nSplitId, 10)
-- recupero lista intersezioni
local OutlineInters = {}
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nOutlineId do
local sName = EgtGetName( nOutlineId)
-- verifico se ci siano intersezioni con questo outline
local ptInters = EgtIP( nSplitId, nOutlineId, EgtSP( nSplitId))
if ptInters then
table.insert( OutlineInters, { Id = nOutlineId, IntersPoint = ptInters})
end
nOutlineId = EgtGetNext( nOutlineId)
end
local ptStartSplit = EgtSP( nSplitId)
local ptEndSplit = EgtEP( nSplitId)
local StartInters
local EndInters
for nIndex = 1, #OutlineInters do
local CurrOutInters = OutlineInters[nIndex]
CurrOutInters.StartDistance = (CurrOutInters.IntersPoint - ptStartSplit):sqlen()
CurrOutInters.EndDistance = (CurrOutInters.IntersPoint - ptEndSplit):sqlen()
if not StartInters or CurrOutInters.StartDistance < StartInters.StartDistance then
StartInters = CurrOutInters
end
if not EndInters or CurrOutInters.EndDistance < EndInters.EndDistance then
EndInters = CurrOutInters
end
end
-- accorcio la curva split su intersezione outline
local dStartSplitInters = EgtCurveParamAtPoint( nSplitId, StartInters.IntersPoint)
EgtTrimCurveStartAtParam( nSplitId, dStartSplitInters)
local dEndSplitInters = EgtCurveParamAtPoint( nSplitId, EndInters.IntersPoint)
EgtTrimCurveEndAtParam( nSplitId, dEndSplitInters)
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, StartInters.Id)
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, EndInters.Id)
-- assegno nome e tipo profilo
EgtSetName( nSplitId, WIN_SPLIT)
EgtSetInfo( nSplitId, WIN_PROFILETYPE, WIN_SASH_HORIZONTAL)
-- creo aree
WinLib.CreateAreaFromSplit( nAreaLayerId, nSplitId)
end
-- funzione che crea tagli split da curve generiche
function WinLib.AddGenSplits( nAreaLayerId, SplitList)
for nIndex = 1, #SplitList do
WinLib.AddSplit( nAreaLayerId, SplitList[nIndex])
end
end
-- funzione che crea le aree da un taglio split
function WinLib.CreateAreaFromSplit( nAreaLayerId, nSplitId)
-- creo layer per le due aree
local nArea1Id = EgtGroup( nAreaLayerId)
local nArea2Id = EgtGroup( nAreaLayerId)
EgtSetInfo( nArea1Id, 'SOU', nSplitId)
EgtSetName( nArea1Id , 'Area' .. 1)
local nArea1OutlineLayerId = EgtGroup( nArea1Id)
EgtSetName( nArea1OutlineLayerId , WIN_AREAOUTLINE)
EgtSetInfo( nArea2Id, 'SOU', nSplitId)
EgtSetName( nArea2Id , 'Area' .. 2)
local nArea2OutlineLayerId = EgtGroup( nArea2Id)
EgtSetName( nArea2OutlineLayerId , WIN_AREAOUTLINE)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_OUTLINE)
--local Outlines = {}
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
local nInters = 0
while nOutlineId and nInters ~= 3 do
local sName = EgtGetName( nOutlineId)
-- calcolo intersezioni con questo outline
local ptInters = EgtIP( nSplitId, nOutlineId, EgtSP( nSplitId))
if ptInters then
if nInters == 0 then
-- trovato primo punto di intersezione - inizio area 2
nInters = 1
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
elseif nInters == 1 then
-- trovato secondo punto di intersezione - fine area 2
nInters = 2
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
local dEndIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveEndAtParam( nCopyId, dEndIntersParam)
-- copio anche split
local nSplitCopyId = EgtCopy( nSplitId, nArea2OutlineLayerId)
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
EgtInvertCurve( nSplitCopyId)
end
-- inizio area 1
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
elseif nInters == 2 then
-- trovato secondo punto di intersezione - fine area 1
nInters = 3
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
local dEndIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveEndAtParam( nCopyId, dEndIntersParam)
-- copio anche split
local nSplitCopyId = EgtCopy( nSplitId, nArea1OutlineLayerId)
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
EgtInvertCurve( nSplitCopyId)
end
end
elseif nInters == 1 then
-- copio nel profilo 2
EgtCopy( nOutlineId, nArea2OutlineLayerId)
elseif nInters == 2 then
-- copio nel profilo 1
EgtCopy( nOutlineId, nArea1OutlineLayerId)
end
-- aggiorno indice
nOutlineId = EgtGetNext( nOutlineId)
-- se arrivato alla fine riparto
if not nOutlineId then
nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
end
end
end
-- funzione che restituisce BBox del Ref del profilo
function WinLib.GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sProfileType)
local nProfileRefId = EgtGetFirstNameInGroup( nProfileId, WIN_REF)
local b3Ref = EgtGetBBox( nProfileRefId, GDB_BB.STANDARD)
return nProfileId, b3Ref, nProfileRefId
end
-- funzione che restituisce ref e calcola delta controprofilo dal profilo passatogli
function WinLib.GetDeltaProfile( nProfileFrameLayerId, sProfileType)
local nProfileId, b3Ref, nProfileRefId = WinLib.GetRefWithBBoxFromProfile( nProfileFrameLayerId, sProfileType)
local nCPId = EgtGetFirstNameInGroup( nProfileId, WIN_CTRIN)
local b3CP = EgtGetBBox( nCPId, GDB_BB.STANDARD)
local dCPDelta = b3Ref:getDimY() - b3CP:getDimY()
return dCPDelta, b3Ref, nProfileId, nProfileRefId
end
-- funzione che crea le curve del geo
function WinLib.CreateFrameGeo( nOutlineId, nPrevOutlineId, nNextOutlineId, StartJointType, EndJointType, nProfileType, nGeoLayerId, nProfileFrameLayerId)
local nCurrCurveId
local nCurrOffsetId
local nPrevCurveId
local nNextCurveId
local dGeoWidth
-- recupero ref e controprofilo e calcolo delta del top, prev e next
local sCurrProfileType = EgtGetInfo( nOutlineId, WIN_PROFILETYPE)
local _, b3CurrRef, nCurrProfileId, nCurrProfileRefId = WinLib.GetDeltaProfile( nProfileFrameLayerId, sCurrProfileType)
local sPrevProfileType = EgtGetInfo( nPrevOutlineId, WIN_PROFILETYPE)
local dPrevCPDelta, _ = WinLib.GetDeltaProfile( nProfileFrameLayerId, sPrevProfileType)
local sNextProfileType = EgtGetInfo( nNextOutlineId, WIN_PROFILETYPE)
local dNextCPDelta, _ = WinLib.GetDeltaProfile( nProfileFrameLayerId, sNextProfileType)
-- calcolo spostamento della curva iniziale dovuto a posizione riferimento
local nProfileFrameId = EgtGetFirstNameInGroup( nCurrProfileId, WIN_SECTIONFRAME)
local frProfile = EgtFR( nProfileFrameId)
local b3CurrProfileFrame = EgtGetBBoxRef( nCurrProfileRefId, GDB_BB.STANDARD, frProfile)
local dCurrOffset = b3CurrProfileFrame:getMax():getX()
-- creo copie degli outline e li offsetto opportunamente
nCurrCurveId = EgtCopy( nOutlineId, nGeoLayerId)
EgtOffsetCurve( nCurrCurveId, dCurrOffset)
nCurrOffsetId = EgtCopy( nOutlineId, nGeoLayerId)
EgtOffsetCurve( nCurrOffsetId, dCurrOffset - b3CurrProfileFrame:getDimX())
EgtInvertCurve( nCurrOffsetId)
if StartJointType == WIN_JNT.ANGLED then
-- calcolo la bisettrice
local vtMedia = ( ( EgtSV( nOutlineId) - EgtEV( nPrevOutlineId)) / 2)
if not vtMedia:normalize() then
vtMedia = EgtSV( nOutlineId)
vtMedia:rotate(Z_AX(), 90)
end
nPrevCurveId = EgtLinePVL( nGeoLayerId, EgtSP( nOutlineId), vtMedia, 3 * b3CurrProfileFrame:getDimX())
EgtInvertCurve( nPrevCurveId)
else
nPrevCurveId = EgtCopy( nPrevOutlineId, nGeoLayerId)
end
if ( StartJointType == WIN_JNT.FULL_V and ( nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP or nProfileType == WIN_PRF.HORIZONTAL)) or
( StartJointType == WIN_JNT.FULL_H and ( nProfileType == WIN_PRF.RIGHT or nProfileType == WIN_PRF.LEFT or nProfileType == WIN_PRF.VERTICAL)) or
nProfileType == WIN_PRF.SPLIT then
EgtOffsetCurve( nPrevCurveId, - dPrevCPDelta)
EgtSetInfo( nGeoLayerId, WIN_STARTCPDELTA, dPrevCPDelta)
end
if EndJointType == WIN_JNT.ANGLED then
-- calcolo la bisettrice
local vtMedia = ( ( EgtSV( nNextOutlineId) - EgtEV( nOutlineId)) / 2)
if not vtMedia:normalize() then
vtMedia = EgtEV( nOutlineId)
vtMedia:rotate(Z_AX(), 90)
end
nNextCurveId = EgtLinePVL( nGeoLayerId, EgtEP( nOutlineId), vtMedia, 3 * b3CurrProfileFrame:getDimX())
EgtInvertCurve( nNextCurveId)
else
nNextCurveId = EgtCopy( nNextOutlineId, nGeoLayerId)
end
if ( StartJointType == WIN_JNT.FULL_V and ( nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP or nProfileType == WIN_PRF.HORIZONTAL)) or
( StartJointType == WIN_JNT.FULL_H and ( nProfileType == WIN_PRF.RIGHT or nProfileType == WIN_PRF.LEFT or nProfileType == WIN_PRF.VERTICAL)) or
nProfileType == WIN_PRF.SPLIT then
EgtOffsetCurve( nNextCurveId, - dNextCPDelta)
EgtSetInfo( nGeoLayerId, WIN_ENDCPDELTA, dNextCPDelta)
end
dGeoWidth = b3CurrProfileFrame:getDimX()
-- salvo delta controprofilo
if StartJointType == WIN_JNT.FULL_V then
end
if EndJointType == WIN_JNT.FULL_V then
end
return nCurrCurveId, nCurrOffsetId, nPrevCurveId, nNextCurveId, dGeoWidth
end
-- funzione che calcola l'ingombro dei pezzi del telaio
function WinLib.CalcFrameGeo( nPartId, nOutlineId, nOutlineLayerId)
-- recupero profilo
local nProfileLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local nProfileFrameLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_FRAME)
-- creo layer per ingombro
local nGeoLayerId = EgtGroup( nPartId)
EgtSetName( nGeoLayerId, WIN_GEO)
-- ricavo tipo dal nome
local sName = EgtGetName( nOutlineId)
local nProfileType = WIN_PRF.NULL
if sName == WIN_TOP then
nProfileType = WIN_PRF.TOP
elseif sName == WIN_BOTTOM then
nProfileType = WIN_PRF.BOTTOM
elseif sName == WIN_LEFT then
nProfileType = WIN_PRF.LEFT
elseif sName == WIN_RIGHT then
nProfileType = WIN_PRF.RIGHT
elseif sName == WIN_VERTICAL then
nProfileType = WIN_PRF.VERTICAL
elseif sName == WIN_HORIZONTAL then
nProfileType = WIN_PRF.HORIZONTAL
elseif sName == WIN_SPLIT then
nProfileType = WIN_PRF.SPLIT
end
local StartJointType
local EndJointType
local nNextOutlineId
local nPrevOutlineId
local nCurrCurveId
local nCurrOffsetId
local nPrevCurveId
local nNextCurveId
local dGeoWidth
if nProfileType == WIN_PRF.TOP then
-- recupero tipo di giunzioni
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
-- recupero outline precedente e successivo
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
elseif nProfileType == WIN_PRF.BOTTOM then
-- recupero tipo di giunzioni
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
-- recupero outline precedente
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
elseif nProfileType == WIN_PRF.LEFT then
-- recupero tipo di giunzioni
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
-- recupero outline precedente
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
elseif nProfileType == WIN_PRF.RIGHT then
-- recupero tipo di giunzioni
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
-- recupero outline precedente
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
elseif nProfileType == WIN_PRF.VERTICAL then
-- recupero tipo di giunzioni
StartJointType = WIN_JNT.FULL_H
EndJointType = WIN_JNT.FULL_H
-- recupero outline precedente
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
elseif nProfileType == WIN_PRF.HORIZONTAL then
-- recupero tipo di giunzioni
StartJointType = WIN_JNT.FULL_V
EndJointType = WIN_JNT.FULL_V
-- recupero outline precedente
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
elseif nProfileType == WIN_PRF.SPLIT then
local nStartId = EgtGetInfo( nOutlineId, WIN_SPLIT_STARTINTERS, 'i')
local nEndId = EgtGetInfo( nOutlineId, WIN_SPLIT_ENDINTERS, 'i')
local sStartName = EgtGetName( nStartId)
local sEndName = EgtGetName( nEndId)
-- recupero tipo di giunzioni
if sStartName == WIN_BOTTOM or sStartName == WIN_TOP then
StartJointType = WIN_JNT.FULL_H
else
StartJointType = WIN_JNT.FULL_V
end
if sEndName == WIN_BOTTOM or sEndName == WIN_TOP then
EndJointType = WIN_JNT.FULL_H
else
EndJointType = WIN_JNT.FULL_V
end
-- recupero outline precedente
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sStartName)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sEndName)
end
-- creo lati dell'outline
nCurrCurveId, nCurrOffsetId, nPrevCurveId, nNextCurveId, dGeoWidth = WinLib.CreateFrameGeo( nOutlineId, nPrevOutlineId, nNextOutlineId, StartJointType, EndJointType, nProfileType, nGeoLayerId, nProfileFrameLayerId)
-- calcolo punti di intersezione
local ptIntersCurrPrev = EgtIP( nCurrCurveId, nPrevCurveId, EgtSP( nCurrCurveId))
if not ptIntersCurrPrev then
-- allungo per intersecare
EgtExtendCurveStartByLen( nCurrCurveId, 200)
EgtExtendCurveEndByLen( nPrevCurveId, 200)
ptIntersCurrPrev = EgtIP( nCurrCurveId, nPrevCurveId, EgtSP( nCurrCurveId))
end
local ptIntersCurrNext = EgtIP( nCurrCurveId, nNextCurveId, EgtEP( nCurrCurveId))
if not ptIntersCurrNext then
-- allungo per intersecare
EgtExtendCurveEndByLen( nCurrCurveId, 200)
EgtExtendCurveStartByLen( nNextCurveId, 200)
ptIntersCurrNext = EgtIP( nCurrCurveId, nNextCurveId, EgtEP( nCurrCurveId))
end
local ptIntersCurrOffsetPrev = EgtIP( nCurrOffsetId, nPrevCurveId, EgtEP( nCurrOffsetId))
if not ptIntersCurrOffsetPrev then
-- allungo per intersecare
EgtExtendCurveEndByLen( nCurrOffsetId, 1000)
EgtExtendCurveStartByLen( nPrevCurveId, 200)
ptIntersCurrOffsetPrev = EgtIP( nCurrOffsetId, nPrevCurveId, EgtEP( nCurrOffsetId))
end
local ptIntersCurrOffsetNext = EgtIP( nCurrOffsetId, nNextCurveId, EgtSP( nCurrOffsetId))
if not ptIntersCurrOffsetNext then
-- allungo per intersecare
EgtExtendCurveStartByLen( nCurrOffsetId, 1000)
EgtExtendCurveStartByLen( nNextCurveId, 200)
ptIntersCurrOffsetNext = EgtIP( nCurrOffsetId, nNextCurveId, EgtSP( nCurrOffsetId))
end
-- calcolo accorciamenti dei lati copiati alle intersezioni
local dIntersCurrPrevParam = EgtCurveParamAtPoint( nCurrCurveId, ptIntersCurrPrev)
EgtTrimCurveStartAtParam( nCurrCurveId, dIntersCurrPrevParam)
local dIntersCurrNextParam = EgtCurveParamAtPoint( nCurrCurveId, ptIntersCurrNext)
EgtTrimCurveEndAtParam( nCurrCurveId, dIntersCurrNextParam)
local dIntersCurrOffsetNextParam = EgtCurveParamAtPoint( nCurrOffsetId, ptIntersCurrOffsetNext)
EgtTrimCurveStartAtParam( nCurrOffsetId, dIntersCurrOffsetNextParam)
local dIntersCurrOffsetPrevParam = EgtCurveParamAtPoint( nCurrOffsetId, ptIntersCurrOffsetPrev)
EgtTrimCurveEndAtParam( nCurrOffsetId, dIntersCurrOffsetPrevParam)
local dIntersPrevOffsetParam = EgtCurveParamAtPoint( nPrevCurveId, ptIntersCurrOffsetPrev)
EgtTrimCurveStartAtParam( nPrevCurveId, dIntersPrevOffsetParam)
local dIntersPrevCurrParam = EgtCurveParamAtPoint( nPrevCurveId, ptIntersCurrPrev)
EgtTrimCurveEndAtParam( nPrevCurveId, dIntersPrevCurrParam)
local dIntersNextCurrParam = EgtCurveParamAtPoint( nNextCurveId, ptIntersCurrNext)
EgtTrimCurveStartAtParam( nNextCurveId, dIntersNextCurrParam)
local dIntersNextOffsetParam = EgtCurveParamAtPoint( nNextCurveId, ptIntersCurrOffsetNext)
EgtTrimCurveEndAtParam( nNextCurveId, dIntersNextOffsetParam)
-- creo composita dai lati
EgtSetName( nCurrCurveId, WIN_GEO_OUT)
EgtSetName( nCurrOffsetId, WIN_GEO_IN)
EgtSetName( nNextCurveId, WIN_GEO_RIGHT)
EgtSetName( nPrevCurveId, WIN_GEO_LEFT)
-- salvo spessore serramento in geo
EgtSetInfo( nCurrCurveId, WIN_GEOWIDTH, dGeoWidth)
return nCurrCurveId
end
-- funzione che posiziona i profili, li estrude e crea il solido
function WinLib.CalcStartEndProfileType(nProfileType, nOutlineId)
local StartJointType
local EndJointType
local nFrameLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_FRAME)
local nOutlineLayerId = EgtGetFirstNameInGroup( nFrameLayerId, WIN_OUTLINE)
local sStartProfileType
local sEndProfileType
if nProfileType == WIN_PRF.BOTTOM then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.ANGLED then
sStartProfileType = WIN_MINIZINKEN
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.ANGLED then
sEndProfileType = WIN_MINIZINKEN
end
elseif nProfileType == WIN_PRF.RIGHT then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BR, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.ANGLED then
sStartProfileType = WIN_MINIZINKEN
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.ANGLED then
sEndProfileType = WIN_MINIZINKEN
end
elseif nProfileType == WIN_PRF.TOP then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TR, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.ANGLED then
sStartProfileType = WIN_MINIZINKEN
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.ANGLED then
sEndProfileType = WIN_MINIZINKEN
end
elseif nProfileType == WIN_PRF.LEFT then
StartJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_TL, 'i')
EndJointType = EgtGetInfo( nOutlineLayerId, WIN_JOINT_BL, 'i')
if StartJointType == WIN_JNT.FULL_H then
sStartProfileType = WIN_CTRINOFST
elseif StartJointType == WIN_JNT.FULL_V then
sStartProfileType = WIN_OUTOFST
elseif StartJointType == WIN_JNT.ANGLED then
sStartProfileType = WIN_MINIZINKEN
end
if EndJointType == WIN_JNT.FULL_H then
sEndProfileType = WIN_CTRINOFST
elseif EndJointType == WIN_JNT.FULL_V then
sEndProfileType = WIN_OUTOFST
elseif EndJointType == WIN_JNT.ANGLED then
sEndProfileType = WIN_MINIZINKEN
end
elseif nProfileType == WIN_PRF.VERTICAL then
StartJointType = WIN_JNT.FULL_H
EndJointType = WIN_JNT.FULL_H
sStartProfileType = WIN_CTRINOFST
sEndProfileType = WIN_CTRINOFST
elseif nProfileType == WIN_PRF.HORIZONTAL then
StartJointType = WIN_JNT.FULL_V
EndJointType = WIN_JNT.FULL_V
sStartProfileType = WIN_CTRINOFST
sEndProfileType = WIN_CTRINOFST
elseif nProfileType == WIN_PRF.SPLIT then
local nStartId = EgtGetInfo( nOutlineId, WIN_SPLIT_STARTINTERS, 'i')
local nEndId = EgtGetInfo( nOutlineId, WIN_SPLIT_ENDINTERS, 'i')
local sStartName = EgtGetName( nStartId)
local sEndName = EgtGetName( nEndId)
-- recupero tipo di giunzioni
if sStartName == WIN_BOTTOM or sStartName == WIN_TOP then
StartJointType = WIN_JNT.FULL_H
else
StartJointType = WIN_JNT.FULL_V
end
if sEndName == WIN_BOTTOM or sEndName == WIN_TOP then
EndJointType = WIN_JNT.FULL_H
else
EndJointType = WIN_JNT.FULL_V
end
sStartProfileType = WIN_CTRINOFST
sEndProfileType = WIN_CTRINOFST
end
return sStartProfileType, sEndProfileType, StartJointType, EndJointType
end
-- funzione che posiziona i profili, li estrude e crea il solido
function WinLib.MakeSolidByExtrusion(nGeoId, nOutlineId, nMainProfileId, nStartProfileId, nEndProfileId, nProfileType, nSolidLayerId)
-- recupero outline
local nPartId = EgtGetParent( nSolidLayerId)
local nAreaId = EgtGetInfo( nPartId, WIN_AREA)
local nGeoLayerId = EgtGetParent( nGeoId)
-- recupero geo
local nPrevGeoId = EgtGetFirstNameInGroup( nGeoLayerId, WIN_GEO_LEFT)
local nNextGeoId = EgtGetFirstNameInGroup( nGeoLayerId, WIN_GEO_RIGHT)
-- recupero BBox e larghezza del geo
local dGeoWidth = EgtGetInfo( nGeoId, WIN_GEOWIDTH, 'd')
-- creo guida Main
local nGuideId = EgtCopy( nOutlineId, nSolidLayerId)
EgtExtendCurveStartByLen( nGuideId, 2 * dGeoWidth)
EgtExtendCurveEndByLen( nGuideId, 2 * dGeoWidth)
-- recupero frame del profilo
local nMainProfileFrameId = EgtGetFirstNameInGroup( nMainProfileId, WIN_SECTIONFRAME)
local frInvertMainProfile = EgtFR( nMainProfileFrameId)
frInvertMainProfile:invert()
-- lo applico a tutte le geometrie del profilo
EgtTransform( EgtGetAllInGroup( nMainProfileId), frInvertMainProfile)
-- assegno come riferimento del profilo il punto start dell'outline
EgtChangeGroupFrame( nMainProfileId, Frame3d( EgtSP( nGuideId), - EgtSV( nGuideId)))
-- recupero outline del profilo Main e lo estrudo
local nMainOutlineId = EgtGetFirstNameInGroup( nMainProfileId, WIN_SECTION)
local nMainExtrusionId = EgtSurfTmSwept( nSolidLayerId, nMainOutlineId, nGuideId, false)
-- posiziono il profilo Start
local nRefStartProfileId = EgtGetFirstNameInGroup( nStartProfileId, WIN_REF)
local b3RefStartProfile = EgtGetBBoxGlob(nRefStartProfileId, GDB_BB.STANDARD)
local dStartDelta = EgtGetInfo( nGeoLayerId, WIN_STARTCPDELTA, 'd') or 0
-- creo guida per estrusione
local nStartGuideId = EgtCopy( nPrevGeoId, nSolidLayerId)
EgtExtendCurveStartByLen( nStartGuideId, 2 * dGeoWidth)
EgtExtendCurveEndByLen( nStartGuideId, 2 * dGeoWidth)
-- recupero frame del profilo
local nStartProfileFrameId = EgtGetFirstNameInGroup( nStartProfileId, WIN_SECTIONFRAME)
local frStartProfile = EgtFR( nStartProfileFrameId)
-- lo sposto se controprofilo
frStartProfile:move( - frStartProfile:getVersX() * dStartDelta)
frStartProfile:invert()
-- lo applico a tutte le geometrie del profilo
EgtTransform( EgtGetAllInGroup( nStartProfileId), frStartProfile)
-- assegno come riferimento del profilo il punto start dell'outline
EgtChangeGroupFrame( nStartProfileId, Frame3d( EgtSP( nStartGuideId), - EgtSV( nStartGuideId)))
-- in base al tipo di incastro e di pezzo, ricavo i controprofili
local sStartProfileType
local sEndProfileType
-- recupero tipo di giunzioni
sStartProfileType, sEndProfileType, StartJointType, EndJointType = WinLib.CalcStartEndProfileType( nProfileType, nOutlineId)
-- recupero outline del profilo Start e lo estrudo
local nOutStartProfileId
if sStartProfileType == WIN_MINIZINKEN then
nOutStartProfileId = EgtLine( nStartProfileId, EgtSP( nPrevGeoId), EgtSP( nPrevGeoId) - Z_AX() * b3RefStartProfile:getDimY(), GDB_RT.GLOB)
EgtInvertCurve( nOutStartProfileId)
else
nOutStartProfileId = EgtGetFirstNameInGroup( nStartProfileId, sStartProfileType)
end
local nStartExtrusionId = EgtSurfTmSwept( nSolidLayerId, nOutStartProfileId, nStartGuideId, false)
-- taglio estrusi per ottenere solido
local nExtrCopyId = EgtCopy( nMainExtrusionId, nSolidLayerId)
EgtSurfTmCut( nMainExtrusionId, nStartExtrusionId, true, false)
EgtSurfTmCut( nStartExtrusionId, nExtrCopyId, true, false)
-- posiziono il profilo End
local nRefEndProfileId = EgtGetFirstNameInGroup( nEndProfileId, WIN_REF)
local b3RefEndProfile = EgtGetBBoxGlob(nRefEndProfileId, GDB_BB.STANDARD)
local dEndDelta = EgtGetInfo( nGeoLayerId, WIN_ENDCPDELTA, 'd') or 0
-- creo guida per estrusione
local nEndGuideId = EgtCopy( nNextGeoId, nSolidLayerId)
EgtExtendCurveStartByLen( nEndGuideId, 2 * dGeoWidth)
EgtExtendCurveEndByLen( nEndGuideId, 2 * dGeoWidth)
-- recupero frame del profilo
local nEndProfileFrameId = EgtGetFirstNameInGroup( nEndProfileId, WIN_SECTIONFRAME)
local frEndProfile = EgtFR( nEndProfileFrameId)
frEndProfile:move( - frEndProfile:getVersX() * dEndDelta)
frEndProfile:invert()
-- lo applico a tutte le geometrie del profilo
EgtTransform( EgtGetAllInGroup( nEndProfileId), frEndProfile)
-- assegno come riferimento del profilo il punto start dell'outline
EgtChangeGroupFrame( nEndProfileId, Frame3d( EgtSP( nEndGuideId), - EgtSV( nEndGuideId)))
-- recupero outline del profilo End e lo estrudo
local nOutEndProfileId
if sEndProfileType == WIN_MINIZINKEN then
nOutEndProfileId = EgtLine( nEndProfileId, EgtSP( nNextGeoId), EgtSP( nNextGeoId) - Z_AX() * b3RefEndProfile:getDimY(), GDB_RT.GLOB)
else
nOutEndProfileId = EgtGetFirstNameInGroup( nEndProfileId, sEndProfileType)
end
-- if (EndJointType == WIN_JNT.FULL_H and ( nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP or nProfileType == WIN_PRF.LEFT)) or
-- (EndJointType == WIN_JNT.FULL_V and ( nProfileType == WIN_PRF.RIGHT)) then
-- EgtInvertCurve( nOutEndProfileId)
-- end
local nEndExtrusionId = EgtSurfTmSwept( nSolidLayerId, nOutEndProfileId, nEndGuideId, false)
-- taglio estrusi per ottenere solido
EgtSurfTmCut( nMainExtrusionId, nEndExtrusionId, true, false)
EgtSurfTmCut( nEndExtrusionId, nExtrCopyId, true, false)
EgtErase( nExtrCopyId)
end
-- funzione che crea il solido del pezzo del telaio
function WinLib.CalcFrameSolid(nPartId, nOutlineId, nGeoId, nOutlineLayerId)
-- recupero profilo
local nProfileId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local nProfileFrameLayerId = EgtGetFirstNameInGroup( nProfileId, WIN_FRAME)
-- creo layer per solido e per profili di estrusione
local nSolidLayerId = EgtGroup( nPartId)
EgtSetName( nSolidLayerId, WIN_SOLID)
local nFrameProfileLayerId = EgtGroup( nPartId)
EgtSetName( nFrameProfileLayerId, WIN_PROFILE)
-- ricavo tipo dal nome
local sName = EgtGetName( nPartId)
local nProfileType = WIN_PRF.NULL
if sName == WIN_TOP then
nProfileType = WIN_PRF.TOP
elseif sName == WIN_BOTTOM then
nProfileType = WIN_PRF.BOTTOM
elseif sName == WIN_LEFT then
nProfileType = WIN_PRF.LEFT
elseif sName == WIN_RIGHT then
nProfileType = WIN_PRF.RIGHT
elseif sName == WIN_VERTICAL then
nProfileType = WIN_PRF.VERTICAL
elseif sName == WIN_HORIZONTAL then
nProfileType = WIN_PRF.HORIZONTAL
elseif sName == WIN_SPLIT then
nProfileType = WIN_PRF.SPLIT
end
local nPrevOutlineId
local nNextOutlineId
local nOrigMainProfileId = GDB_ID.NULL
local nMainProfileId = GDB_ID.NULL
local nOrigStartProfileId = GDB_ID.NULL
local nStartProfileId = GDB_ID.NULL
local nOrigEndProfileId = GDB_ID.NULL
local nEndProfileId = GDB_ID.NULL
-- recupero outline precedente e successivo
if nProfileType == WIN_PRF.BOTTOM then
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
elseif nProfileType == WIN_PRF.RIGHT then
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
elseif nProfileType == WIN_PRF.TOP then
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
elseif nProfileType == WIN_PRF.LEFT then
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
elseif nProfileType == WIN_PRF.VERTICAL then
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_BOTTOM)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_TOP)
elseif nProfileType == WIN_PRF.HORIZONTAL then
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_LEFT)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
elseif nProfileType == WIN_PRF.SPLIT then
local nStartId = EgtGetInfo( nOutlineId, WIN_SPLIT_STARTINTERS, 'i')
local nEndId = EgtGetInfo( nOutlineId, WIN_SPLIT_ENDINTERS, 'i')
local sStartName = EgtGetName( nStartId)
local sEndName = EgtGetName( nEndId)
nPrevOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sStartName)
nNextOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, sEndName)
end
-- recupero profilo e controprofili
local sCurrProfileType = EgtGetInfo( nOutlineId, WIN_PROFILETYPE)
local sPrevProfileType = EgtGetInfo( nPrevOutlineId, WIN_PROFILETYPE)
local sNextProfileType = EgtGetInfo( nNextOutlineId, WIN_PROFILETYPE)
nOrigMainProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sCurrProfileType)
nOrigStartProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sPrevProfileType)
nOrigEndProfileId = EgtGetFirstNameInGroup( nProfileFrameLayerId, sNextProfileType)
-- creo copie di profilo e controprofili
nMainProfileId = EgtCopy( nOrigMainProfileId, nFrameProfileLayerId)
EgtSetName( nMainProfileId, WIN_PRF_MAIN)
nStartProfileId = EgtCopy( nOrigStartProfileId, nFrameProfileLayerId)
EgtSetName( nStartProfileId, WIN_PRF_START)
nEndProfileId = EgtCopy( nOrigEndProfileId, nFrameProfileLayerId)
EgtSetName( nEndProfileId, WIN_PRF_END)
-- creo solido dai profili
WinLib.MakeSolidByExtrusion(nGeoId, nOutlineId, nMainProfileId, nStartProfileId, nEndProfileId, nProfileType, nSolidLayerId)
end
-- funzione che calcola l'ingombro dei pezzi del telaio
function WinLib.CreatePartFromOutline( nAreaLayerId, nOutlineId)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_OUTLINE)
-- se area senza outline, cerco quella superiore
if not nOutlineLayerId then
local nParentAreaLayerId = EgtGetParent( nAreaLayerId)
if nParentAreaLayerId then
nOutlineLayerId = EgtGetFirstNameInGroup( nParentAreaLayerId, WIN_OUTLINE)
end
end
-- ricavo tipo dal nome
local sName = EgtGetName( nOutlineId)
local nProfileType = WIN_PRF.NULL
if sName == WIN_TOP then
nProfileType = WIN_PRF.TOP
elseif sName == WIN_BOTTOM then
nProfileType = WIN_PRF.BOTTOM
elseif sName == WIN_LEFT then
nProfileType = WIN_PRF.LEFT
elseif sName == WIN_RIGHT then
nProfileType = WIN_PRF.RIGHT
elseif sName == WIN_VERTICAL then
nProfileType = WIN_PRF.VERTICAL
elseif sName == WIN_HORIZONTAL then
nProfileType = WIN_PRF.HORIZONTAL
elseif sName == WIN_SPLIT then
nProfileType = WIN_PRF.SPLIT
end
-- creo pezzo
local nPartId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nPartId, sName)
if nProfileType == WIN_PRF.BOTTOM or nProfileType == WIN_PRF.TOP or nProfileType == WIN_PRF.HORIZONTAL then
EgtSetColor( nPartId, Color3d( 204, 102, 0))
elseif nProfileType == WIN_PRF.RIGHT or nProfileType == WIN_PRF.LEFT or nProfileType == WIN_PRF.VERTICAL then
EgtSetColor( nPartId, Color3d( 251, 128, 4))
else
EgtSetColor( nPartId, Color3d( 255, 159, 57))
end
-- inserisco riferimento alla sua area
EgtSetInfo( nPartId, WIN_AREA, nAreaLayerId)
-- disegno ingombro
local nGeoId = WinLib.CalcFrameGeo( nPartId, nOutlineId, nOutlineLayerId)
-- disegno solido
WinLib.CalcFrameSolid(nPartId, nOutlineId, nGeoId, nOutlineLayerId)
-- offset per distanziare i pezzi
--local dYPosOffset = 300 * ( nProfileType - 1)
--EgtChangeGroupFrame( nPartId, Frame3d( Point3d( 0, dYPosOffset, 0)))
end
-- funzione che posiziona un pezzo
function WinLib.PositionPart(nPartId)
-- ricavo tipo dal nome
local sName = EgtGetName( nPartId)
local sDelta = ''
if sName == WIN_BOTTOM then
sDelta = WIN_STARTCPDELTA
elseif sName == WIN_RIGHT then
sDelta = WIN_STARTCPDELTA
elseif sName == WIN_TOP then
sDelta = WIN_STARTCPDELTA
elseif sName == WIN_LEFT then
sDelta = WIN_STARTCPDELTA
end
-- calcolo nuovo riferimento
local nGeoPartLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
local nGeoPartId = EgtGetFirstNameInGroup( nGeoPartLayerId, sName)
local dDelta = EgtGetInfo( nGeoPartId, sDelta, 'd') or 0
local nFrameLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_FRAME)
local nOutlineLayerId = EgtGetFirstNameInGroup( nFrameLayerId, WIN_OUTLINE)
local nFramePartId = EgtGetFirstNameInGroup( nOutlineLayerId, sName)
local vtStart = EgtSV( nFramePartId)
local ptStart = EgtSP( nFramePartId) + vtStart * dDelta
local _, _, dAngRight = SphericalFromVector(vtStart)
local frStart = Frame3d( ptStart)
frStart:rotate( frStart:getOrigin(), Z_AX(), dAngRight)
EgtChangeGroupFrame( nPartId, frStart)
end
-- funzione che assembla i pezzi
function WinLib.AssembleFrame()
local nBottomPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_BOTTOM)
WinLib.PositionPart(nBottomPartId)
local nRightPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_RIGHT)
WinLib.PositionPart(nRightPartId)
local nTopPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_TOP)
WinLib.PositionPart(nTopPartId)
local nLeftPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_LEFT)
WinLib.PositionPart(nLeftPartId)
-- assemblo i pezzi
--local nRightPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_RIGHT)
--local nGeoRightLayerId = EgtGetFirstNameInGroup( nRightPartId, WIN_GEO)
--local nGeoRightId = EgtGetFirstNameInGroup( nGeoRightLayerId, WIN_RIGHT)
--local dDelta = EgtGetInfo( nGeoRightId, WIN_BOTTOMCPDELTA, 'd')
--local nFrameLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_FRAME)
--local nOutlineLayerId = EgtGetFirstNameInGroup( nFrameLayerId, WIN_OUTLINE)
--local nFrameRightId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_RIGHT)
--local vtRight = EgtSV( nFrameRightId)
--local ptRight = EgtSP( nFrameRightId) + vtRight * dDelta
--local _, _, dAngRight = SphericalFromVector(vtRight)
--local frRight = Frame3d( ptRight)
--frRight:rotate( frRight:getOrigin(), Z_AX(), dAngRight)
--EgtChangeGroupFrame( nRightPartId, frRight)
end
---------------------------------------------------------------------
return WinLib
File diff suppressed because it is too large Load Diff
-453
View File
@@ -1,453 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinCreate = {}
-- Include
require( 'EgtBase')
require( 'WinConst')
-- funzioni
-- funzione che importa il profilo
function WinCreate.ImportProfile( sProfilePath)
-- verifico esistenza file
if not EgtExistsFile( sProfilePath) then
EgtOutLog( 'File del profilo non trovato! ' .. sProfilePath)
EgtOutText( 'File del profilo non trovato! ' .. sProfilePath)
EgtPause(5000)
return false
end
-- creo gruppo per il profilo
local nProfileId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nProfileId, WIN_PROFILE)
-- importo profilo prescelto
local bOk = EgtInsertFile( sProfilePath)
-- recupero gruppi importati e li sposto nel gruppo profilo
local nGroupId = EgtGetFirstInGroup( GDB_ID.ROOT)
while nGroupId do
if nGroupId ~= nProfileId then
local nCurrId = nGroupId
nGroupId = EgtGetNext( nGroupId)
EgtRelocateGlob( nCurrId, nProfileId)
EgtSetStatus( nCurrId, GDB_ST.OFF)
else
nGroupId = EgtGetNext( nGroupId)
end
end
-- riporto path nel Part del profilo
EgtSetInfo( nProfileId, WIN_PROFILEPATH, sProfilePath)
return true
end
-- funzione che crea il buco rettangolare per la finestra
function WinCreate.CreateFrame( dWidth, dHeight, nJointBL, nJointBR, nJointTR, nJointTL)
-- creo gruppo per telaio
local nFrameAreaId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
-- imposto il tipo
EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
local nAreaOutlineLayerId = EgtGroup( nFrameAreaId)
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
-- disegno outline
local nFrameBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
EgtSetName( nFrameBottomId, WIN_BOTTOM)
local nFrameRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
EgtSetName( nFrameRightId, WIN_RIGHT)
local nFrameTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
EgtSetName( nFrameTopId, WIN_TOP)
local nFrameLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
EgtSetName( nFrameLeftId, WIN_LEFT)
-- imposto tipo giunzioni
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
return nFrameAreaId
end
-- funzione che crea il buco per la finestra
function WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, nJointBL, nJointBR, nJointTR, nJointTL)
-- creo gruppo per telaio
local nFrameAreaId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
-- imposto il tipo
EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
local nAreaOutlineLayerId = EgtGroup( nFrameAreaId)
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
-- disegno outline
EgtRelocateGlob( nFrameBottomId, nAreaOutlineLayerId)
EgtSetName( nFrameBottomId, WIN_BOTTOM)
EgtRelocateGlob( nFrameRightId, nAreaOutlineLayerId)
EgtSetName( nFrameRightId, WIN_RIGHT)
EgtRelocateGlob( nFrameTopId, nAreaOutlineLayerId)
EgtSetName( nFrameTopId, WIN_TOP)
EgtRelocateGlob( nFrameLeftId, nAreaOutlineLayerId)
EgtSetName( nFrameLeftId, WIN_LEFT)
-- imposto tipo giunzioni
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
return nFrameAreaId
end
-- -- funzione che crea il telaio a partire dal buco
-- function WinCreate.CreateFrameOnHole( nHoleLayerId, dWidth, dHeight)
-- local nAreaOutlineLayerId = EgtGroup( nHoleLayerId)
-- EgtSetName( nAreaOutlineLayerId, WIN_OUTLINE)
-- -- disegno outline
-- local nHoleBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
-- EgtSetName( nHoleBottomId, WIN_BOTTOM)
-- local nHoleRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
-- EgtSetName( nHoleRightId, WIN_RIGHT)
-- local nHoleTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
-- EgtSetName( nHoleTopId, WIN_TOP)
-- local nHoleLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
-- EgtSetName( nHoleLeftId, WIN_LEFT)
-- end
-- funzione che aggiunge una anta
function WinCreate.AddSash( nAreaId, nJointBL, nJointBR, nJointTR, nJointTL, nSashType)
-- creo nuova area
local nSashAreaId = EgtGroup( nAreaId)
EgtSetName( nSashAreaId, WIN_AREA .. '(' .. WIN_SASH .. ')')
-- imposto il tipo
EgtSetInfo( nSashAreaId, WIN_AREATYPE, WIN_AREATYPES.SASH)
-- recupero outline area precedente
local nPrevAreaOutlineId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
-- lo copio per outline area dell'anta
local nAreaOutlineLayerId = EgtGroup( nSashAreaId)
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
local nAreaOutlineId = EgtGetFirstInGroup( nPrevAreaOutlineId)
while nAreaOutlineId do
local nOutlineId = EgtCopy( nAreaOutlineId, nAreaOutlineLayerId)
EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId)
EgtSetInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
nAreaOutlineId = EgtGetNext( nAreaOutlineId)
end
-- imposto tipo giunzioni
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
-- imposto tipo di anta se presente
if nSashType then
EgtSetInfo( nSashAreaId, WIN_SASHTYPE, nSashType)
end
return nSashAreaId
end
-- funzione che aggiunge un riempimento
function WinCreate.AddFill( nAreaId, FillType)
-- creo nuova area
local nFillAreaId = EgtGroup( nAreaId)
EgtSetName( nFillAreaId, WIN_AREA .. '(' .. WIN_FILL .. ')')
-- imposto il tipo
EgtSetInfo( nFillAreaId, WIN_AREATYPE, WIN_AREATYPES.FILL)
-- recupero outline area precedente
local nPrevAreaOutlineId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
-- lo copio per outline area del riempimento
local nAreaOutlineLayerId = EgtGroup( nFillAreaId)
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
local nAreaOutlineId = EgtGetFirstInGroup( nPrevAreaOutlineId)
while nAreaOutlineId do
local nOutlineId = EgtCopy( nAreaOutlineId, nAreaOutlineLayerId)
EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId)
EgtSetInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BL)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BR)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TL)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TR)
nAreaOutlineId = EgtGetNext( nAreaOutlineId)
end
-- imposto tipo di fill
EgtSetInfo( nFillAreaId, WIN_FILLTYPE, FillType)
return nFillAreaId
end
-- funzione che crea un taglio split
function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion, nSplitType)
-- creo layer temporaneo per split
local nTempSplitLayerId = EgtGroup( nAreaLayerId)
EgtSetName( nTempSplitLayerId, WIN_TEMPSPLIT)
-- recupero contorno area precedente
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
local OutlineIds = {}
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nOutlineId do
local sName = EgtGetName( nOutlineId)
table.insert( OutlineIds, nOutlineId)
nOutlineId = EgtGetNext( nOutlineId)
end
local nTotSplitId
if SplitType == WIN_SPLITORIENTATION.VERTICAL then
-- creo linea
local nCalcPosition = 0
if MeasureType == WIN_MEASURE.ABSOLUT then
nCalcPosition = nPosition
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
nCalcPosition = b3OutlineLayer:getDimX() / nProportion * nPosition
end
nTotSplitId = EgtLine( nTempSplitLayerId, b3OutlineLayer:getMin() + X_AX() * nCalcPosition, b3OutlineLayer:getMin() + X_AX() * nCalcPosition + Y_AX() * b3OutlineLayer:getDimY())
elseif SplitType == WIN_SPLITORIENTATION.HORIZONTAL then
-- creo linea
local nCalcPosition = 0
if MeasureType == WIN_MEASURE.ABSOLUT then
nCalcPosition = nPosition
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
nCalcPosition = b3OutlineLayer:getDimY() / nProportion * nPosition
end
nTotSplitId = EgtLine( nTempSplitLayerId, b3OutlineLayer:getMin() + Y_AX() * nCalcPosition, b3OutlineLayer:getMin() + Y_AX() * nCalcPosition + X_AX() * b3OutlineLayer:getDimX())
end
-- calcolo split
local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nAreaLayerId, nTotSplitId, nSplitType)
EgtErase( nTempSplitLayerId)
return nArea1Id, nArea2Id
end
-- funzione che crea tagli split multipli
function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList, nProportion)
if MeasureType == WIN_MEASURE.ABSOLUT then
for nIndex = 1, #PositionList do
WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, PositionList[nIndex], nProportion)
end
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
for nIndex = 1, #PositionList do
WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, PositionList[nIndex], nProportion)
end
end
end
-- funzione che crea un taglio split da una curva generica
function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
-- se area nulla diventa di tipo split
local nAreaType = EgtGetInfo( nAreaLayerId, WIN_AREATYPE, 'i')
if nAreaType == WIN_AREATYPES.NULL then
EgtSetInfo( nAreaLayerId, WIN_AREATYPE, WIN_AREATYPES.SPLIT)
end
-- creo layer per split
local nSplitLayerId = EgtGroup( nAreaLayerId)
EgtSetName( nSplitLayerId, WIN_BASESPLIT)
-- sposto curva split nel layer
EgtRelocateGlob( nSplitId, nSplitLayerId)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
-- allungo curva split per cercare intersezioni
EgtExtendCurveStartByLen( nSplitId, 10)
EgtExtendCurveEndByLen( nSplitId, 10)
-- recupero lista intersezioni
local OutlineInters = {}
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
while nOutlineId do
local sName = EgtGetName( nOutlineId)
-- verifico se ci siano intersezioni con questo outline
local ptInters = EgtIP( nSplitId, nOutlineId, EgtSP( nSplitId))
if ptInters then
table.insert( OutlineInters, { Id = nOutlineId, IntersPoint = ptInters})
end
nOutlineId = EgtGetNext( nOutlineId)
end
local ptStartSplit = EgtSP( nSplitId)
local ptEndSplit = EgtEP( nSplitId)
local StartInters
local EndInters
for nIndex = 1, #OutlineInters do
local CurrOutInters = OutlineInters[nIndex]
CurrOutInters.StartDistance = (CurrOutInters.IntersPoint - ptStartSplit):sqlen()
CurrOutInters.EndDistance = (CurrOutInters.IntersPoint - ptEndSplit):sqlen()
if not StartInters or CurrOutInters.StartDistance < StartInters.StartDistance then
StartInters = CurrOutInters
end
if not EndInters or CurrOutInters.EndDistance < EndInters.EndDistance then
EndInters = CurrOutInters
end
end
-- accorcio la curva split su intersezione outline
local dStartSplitInters = EgtCurveParamAtPoint( nSplitId, StartInters.IntersPoint)
EgtTrimCurveStartAtParam( nSplitId, dStartSplitInters)
local dEndSplitInters = EgtCurveParamAtPoint( nSplitId, EndInters.IntersPoint)
EgtTrimCurveEndAtParam( nSplitId, dEndSplitInters)
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, StartInters.Id)
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, EndInters.Id)
-- assegno nome profilo
EgtSetName( nSplitId, WIN_SPLIT)
-- creo aree
local nArea1Id, nArea2Id = WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
-- verifico se discende da Frame
local nParentAreaId = nAreaLayerId
local nParentAreaType = nAreaType
-- recupero parent fino a trovare frame o sash
while nParentAreaType ~= WIN_AREATYPES.FRAME and nParentAreaType ~= WIN_AREATYPES.SASH do
nParentAreaId = EgtGetParent( nParentAreaId)
nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i')
end
if nParentAreaType == WIN_AREATYPES.FRAME and nSplitType then
-- imposto tipo di split
EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, nSplitType)
-- EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, EgtIf( not nSplitType, WIN_SPLITTYPES.MULLION, nSplitType))
end
return nArea1Id, nArea2Id
end
-- funzione che crea tagli split da curve generiche
function WinCreate.AddGenSplits( nAreaLayerId, SplitList)
for nIndex = 1, #SplitList do
WinCreate.AddSplit( nAreaLayerId, SplitList[nIndex])
end
end
-- funzione che crea le aree da un taglio split
function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
-- creo layer per le due aree
local nArea1Id = EgtGroup( nAreaLayerId)
EgtSetName( nArea1Id , WIN_AREA1)
EgtSetInfo( nArea1Id, WIN_AREATYPE, WIN_AREATYPES.NULL)
local nArea1OutlineLayerId = EgtGroup( nArea1Id)
EgtSetName( nArea1OutlineLayerId , WIN_AREAOUTLINE)
local nArea2Id = EgtGroup( nAreaLayerId)
EgtSetName( nArea2Id , WIN_AREA2)
EgtSetInfo( nArea2Id, WIN_AREATYPE, WIN_AREATYPES.NULL)
local nArea2OutlineLayerId = EgtGroup( nArea2Id)
EgtSetName( nArea2OutlineLayerId , WIN_AREAOUTLINE)
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
local nInters = 0
while nOutlineId and nInters ~= 3 do
local sName = EgtGetName( nOutlineId)
-- calcolo intersezioni con questo outline
local ptInters = EgtIP( nSplitId, nOutlineId, EgtSP( nSplitId))
if ptInters then
if nInters == 0 then
-- trovato primo punto di intersezione - inizio area 2
nInters = 1
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
elseif nInters == 1 then
-- trovato secondo punto di intersezione - fine area 2
nInters = 2
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
local dEndIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveEndAtParam( nCopyId, dEndIntersParam)
-- copio anche split
local nSplitCopyId = EgtCopy( nSplitId, nArea2OutlineLayerId)
EgtSetInfo( nSplitCopyId, WIN_SOU, nSplitId)
EgtSetInfo( nSplitId, WIN_CHILD, nSplitCopyId)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_STARTINTERS)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_ENDINTERS)
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
EgtInvertCurve( nSplitCopyId)
end
-- verifico direzione per dare nome
local vtMedia = ( ( EgtEV( nSplitCopyId) - EgtSV( nSplitCopyId)) / 2)
if not vtMedia:normalize() then
vtMedia = EgtSV( nSplitCopyId)
end
if abs( vtMedia:getX()) > abs( vtMedia:getY()) then
EgtSetName( nSplitCopyId, WIN_BOTTOM)
else
EgtSetName( nSplitCopyId, WIN_LEFT)
end
-- inizio area 1
nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
elseif nInters == 2 then
-- trovato secondo punto di intersezione - fine area 1
nInters = 3
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
local dEndIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveEndAtParam( nCopyId, dEndIntersParam)
-- copio anche split
local nSplitCopyId = EgtCopy( nSplitId, nArea1OutlineLayerId)
EgtRemoveName( nSplitCopyId)
EgtSetInfo( nSplitCopyId, WIN_SOU, nSplitId)
EgtSetInfo( nSplitId, WIN_CHILD, nSplitCopyId)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_STARTINTERS)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_ENDINTERS)
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
EgtInvertCurve( nSplitCopyId)
end
-- verifico direzione per dare nome
local vtMedia = ( ( EgtEV( nSplitCopyId) - EgtSV( nSplitCopyId)) / 2)
if not vtMedia:normalize() then
vtMedia = EgtSV( nSplitCopyId)
end
if abs( vtMedia:getX()) > abs( vtMedia:getY()) then
EgtSetName( nSplitCopyId, WIN_TOP)
else
EgtSetName( nSplitCopyId, WIN_RIGHT)
end
end
elseif nInters == 1 then
-- copio nel profilo 2
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
elseif nInters == 2 then
-- copio nel profilo 1
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
end
-- aggiorno indice
nOutlineId = EgtGetNext( nOutlineId)
-- se arrivato alla fine riparto
if not nOutlineId then
nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
end
end
-- scorro pezzi del primo e secondo outline per avere bottom come primo
local nFirstInAreaId = EgtGetFirstInGroup( nArea1OutlineLayerId)
local sFirstInAreaName = EgtGetName( nFirstInAreaId)
while sFirstInAreaName ~= WIN_BOTTOM do
EgtRelocate( nFirstInAreaId, nArea1OutlineLayerId)
nFirstInAreaId = EgtGetFirstInGroup( nArea1OutlineLayerId)
sFirstInAreaName = EgtGetName( nFirstInAreaId)
end
nFirstInAreaId = EgtGetFirstInGroup( nArea2OutlineLayerId)
sFirstInAreaName = EgtGetName( nFirstInAreaId)
while sFirstInAreaName ~= WIN_BOTTOM do
EgtRelocate( nFirstInAreaId, nArea2OutlineLayerId)
nFirstInAreaId = EgtGetFirstInGroup( nArea2OutlineLayerId)
sFirstInAreaName = EgtGetName( nFirstInAreaId)
end
-- error('qqq')
return nArea1Id, nArea2Id
end
-- funzione che aggiunge uno zoccolo
function WinCreate.AddBottomRail( nAreaId)
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
if nAreaType == WIN_AREATYPES.FRAME then
-- recupero l'outline bottom
local nBaseOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
-- local nBottomOutlineId = EgtGetFirstNameInGroup( nBaseOutlineLayerId, WIN_BOTTOM)
EgtSetInfo( nBaseOutlineLayerId, WIN_BOTTOMRAIL, 1)
end
end
---------------------------------------------------------------------
return WinCreate
-34
View File
@@ -1,34 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinDesign = {}
-- Include
require( 'EgtBase')
require( 'WinConst')
-- funzioni
function WinDesign.DesignFrame( dWidth, dHeight, nJointBL, nJointBR, nJointTR, nJointTL)
end
function WinDesign.DesignSash( sFilePath)
end
---------------------------------------------------------------------
return WinDesign
-259
View File
@@ -1,259 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
-- Tabella per definizione modulo
local WinManageProject = {}
-- Include
require( 'EgtBase')
_G.package.loaded.WinConst = nil
require( 'WinConst')
_G.package.loaded.WinJWDConst = nil
require( 'WinJWDConst')
_G.package.loaded.WinCreate = nil
local WinCreate = require( 'WinCreate')
_G.package.loaded.JSON = nil
local JSON = require( 'JSON')
-- funzioni
local function ConvertCurveToTableEntity( nCurveId)
-- verifico il tipo di entita'
local nBaseOutlineType = EgtGetType( nCurveId)
if nBaseOutlineType == GDB_TY.CRV_LINE then
local ptStart = EgtSP( nCurveId)
local ptEnd = EgtEP( nCurveId)
return { [JWD_CRV_TYPE] = nBaseOutlineType, [JWD_POINT_START] = ptStart, [JWD_POINT_END] = ptEnd}
elseif nBaseOutlineType == GDB_TY.CRV_ARC then
local ptStart = EgtSP( nCurveId)
local ptEnd = EgtEP( nCurveId)
local ptMid = EgtMP( nCurveId)
return { [JWD_CRV_TYPE] = nBaseOutlineType, [JWD_POINT_START] = ptStart, [JWD_POINT_END] = ptEnd, [JWD_POINT_MID] = ptMid}
elseif nBaseOutlineType == GDB_TY.CRV_COMPO then
-- local ptStart = EgtSP( nCurveId)
-- local ptEnd = EgtEP( nCurveId)
-- local ptMid = EgtMP( nCurveId)
-- return { Type = nBaseOutlineType, ptStart = ptStart, ptEnd = ptEnd, ptMid = ptMid}
end
end
-- funzione ricorsiva che legge le aree e ne riporta i dati in tabella
local function ConvertAreaToTable( nAreaId)
local AreaTable = {}
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
AreaTable[JWD_AREA_TYPE] = nAreaType
if nAreaType == WIN_AREATYPES.NULL then
-- non faccio nulla
elseif nAreaType == WIN_AREATYPES.FRAME then
-- recupero outline del frame
local nBaseOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE, 'i')
local JointTable = {}
-- recupero tipo giunzioni
local nJointBL = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_BL, 'i')
local nJointBR = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_BR, 'i')
local nJointTL = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_TL, 'i')
local nJointTR = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_TR, 'i')
JointTable[JWD_JOINT_BL] = nJointBL
JointTable[JWD_JOINT_BR] = nJointBR
JointTable[JWD_JOINT_TL] = nJointTL
JointTable[JWD_JOINT_TR] = nJointTR
local OutlineTable = {}
-- recupero contorno
local nBaseOutlineId = EgtGetFirstInGroup( nBaseOutlineLayerId)
local nBaseOutlineIndex = 1
while nBaseOutlineId do
local Entity = ConvertCurveToTableEntity( nBaseOutlineId)
table.insert( OutlineTable, Entity)
nBaseOutlineIndex = nBaseOutlineIndex + 1
nBaseOutlineId = EgtGetNext( nBaseOutlineId)
end
AreaTable[JWD_JOINT] = JointTable
AreaTable[JWD_OUTLINE] = OutlineTable
-- verifico se c'e' BottomRail
local nBottomRailId = EgtGetInfo( nBaseOutlineLayerId, WIN_BOTTOMRAIL, 'i')
if nBottomRailId then
AreaTable[JWD_BOTTOM_RAIL] = 1
end
elseif nAreaType == WIN_AREATYPES.SASH then
local nBaseOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
local JointTable = {}
-- recupero tipo giunzioni
local nJointBL = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_BL, 'i')
local nJointBR = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_BR, 'i')
local nJointTL = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_TL, 'i')
local nJointTR = EgtGetInfo( nBaseOutlineLayerId, WIN_JOINT_TR, 'i')
JointTable[JWD_JOINT_BL] = nJointBL
JointTable[JWD_JOINT_BR] = nJointBR
JointTable[JWD_JOINT_TL] = nJointTL
JointTable[JWD_JOINT_TR] = nJointTR
AreaTable[JWD_JOINT] = JointTable
local nSashType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i')
if nSashType then
AreaTable[JWD_SASH_TYPE] = nSashType
end
elseif nAreaType == WIN_AREATYPES.FILL then
local nFillType = EgtGetInfo( nAreaId, WIN_FILLTYPE, 'i')
AreaTable[JWD_FILL_TYPE] = nFillType
elseif nAreaType == WIN_AREATYPES.SPLIT then
end
-- verifico se c'e' Split
local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT)
if nSplitLayerId then
local SplitTable = {}
local nSplitId = EgtGetFirstInGroup( nSplitLayerId)
local Entity = ConvertCurveToTableEntity( nSplitId)
table.insert( SplitTable, Entity)
AreaTable[JWD_SPLIT] = SplitTable
end
-- ciclo sulle aree contenute
local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAASTERISK)
local nChildIndex = 1
while nChildAreaId do
local ChildTable = ConvertAreaToTable( nChildAreaId)
local AreaName = JWD_AREA .. nChildIndex
AreaTable[AreaName] = ChildTable
nChildIndex = nChildIndex + 1
nChildAreaId = EgtGetNextName( nChildAreaId, WIN_AREAASTERISK)
end
return AreaTable
end
-- funzione che converte una curva descritta in tabella in una geometria
local function ConvertCurveTableToEntity( nDrawFrameLayerId, CurrCurve)
if CurrCurve[JWD_CRV_TYPE] == GDB_TY.CRV_LINE then
EgtLine( nDrawFrameLayerId, Point3d(CurrCurve[JWD_POINT_START]), Point3d(CurrCurve[JWD_POINT_END]))
elseif CurrCurve[JWD_CRV_TYPE] == GDB_TY.CRV_ARC then
EgtArc3P( nDrawFrameLayerId, Point3d(CurrCurve[JWD_POINT_START]), Point3d(CurrCurve[JWD_POINT_MID]), Point3d(CurrCurve[JWD_POINT_END]))
elseif CurrCurve[JWD_CRV_TYPE] == GDB_TY.CRV_COMPO then
-- local ptStart = EgtSP( nBaseOutlineId)
-- local ptEnd = EgtEP( nBaseOutlineId)
-- local ptMid = EgtMP( nBaseOutlineId)
-- local Entity = { Type = nBaseOutlineType, ptStart = ptStart, ptEnd = ptEnd, ptMid = ptMid}
end
end
-- funzione ricorsiva che legge le aree in tabella e crea le geometrie
local function ConvertTableToGeometry( AreaTable, nAreaId)
if AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.NULL then
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.FRAME then
-- creo gruppo e layer per contorno
local nDrawFramePartId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nDrawFramePartId, 'DrawFrame')
local nDrawFrameLayerId = EgtGroup( nDrawFramePartId)
for nIndex = 1, #AreaTable[JWD_OUTLINE] do
local CurrCurve = AreaTable[JWD_OUTLINE][nIndex]
ConvertCurveTableToEntity( nDrawFrameLayerId, CurrCurve)
end
local nFrameBottomId = EgtGetFirstInGroup(nDrawFrameLayerId)
local nFrameRightId = EgtGetNext(nFrameBottomId)
local nFrameTopId = EgtGetNext(nFrameRightId)
local nFrameLeftId = EgtGetNext(nFrameTopId)
-- creo frame
nAreaId = WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, AreaTable[JWD_JOINT][JWD_JOINT_BL], AreaTable[JWD_JOINT][JWD_JOINT_BR], AreaTable[JWD_JOINT][JWD_JOINT_TR], AreaTable[JWD_JOINT][JWD_JOINT_TL])
-- elimino contorno frame
EgtErase( nDrawFramePartId)
-- se BottomRail
if AreaTable[JWD_BOTTOM_RAIL] and AreaTable[JWD_BOTTOM_RAIL] == 1 then
WinCreate.AddBottomRail( nAreaId)
end
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.SASH then
nAreaId = WinCreate.AddSash( nAreaId, AreaTable[JWD_JOINT][JWD_JOINT_BL], AreaTable[JWD_JOINT][JWD_JOINT_BR], AreaTable[JWD_JOINT][JWD_JOINT_TR], AreaTable[JWD_JOINT][JWD_JOINT_TL], AreaTable[JWD_SASH_TYPE])
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.FILL then
WinCreate.AddFill( nAreaId, AreaTable[JWD_FILL_TYPE])
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.SPLIT then
end
-- verifico se c'e' Split
if AreaTable[JWD_SPLIT] then
-- creo gruppo e layer per Split
local nDrawFramePartId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nDrawFramePartId, 'DrawFrame')
local nDrawFrameLayerId = EgtGroup( nDrawFramePartId)
ConvertCurveTableToEntity( nDrawFrameLayerId, AreaTable[JWD_SPLIT][1])
local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nAreaId, EgtGetFirstInGroup(nDrawFrameLayerId)) --, nSplitType)
EgtErase(nDrawFramePartId)
ConvertTableToGeometry( AreaTable[JWD_AREA .. 1], nArea1Id)
ConvertTableToGeometry( AreaTable[JWD_AREA .. 2], nArea2Id)
else
-- ciclo sulle sotto aree
local nChildIndex = 1
while AreaTable[JWD_AREA ..nChildIndex] do
ConvertTableToGeometry( AreaTable[JWD_AREA ..nChildIndex], nAreaId)
nChildIndex = nChildIndex + 1
end
end
end
-- funzione che crea le tabelle gerarchiche dalla struttura geometrica
function WinManageProject.CreateTableFromGeom( nFrameId)
-- creo la tabella
local WinTable = {}
-- riporto la path del profilo
local nProfileId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
local sProfilePath = EgtGetInfo( nProfileId, WIN_PROFILEPATH)
WinTable[JWD_PROFILE_PATH] = sProfilePath
-- leggo aree
local FrameTable = ConvertAreaToTable( nFrameId)
local AreaName = JWD_AREA .. 1
WinTable[AreaName] = FrameTable
return WinTable
end
-- funzione che crea la struttura geometrica dalle tabelle gerarchiche
function WinManageProject.CreateGeomFromTable( WinTable)
-- importo profilo
if not WinCreate.ImportProfile( WinTable[JWD_PROFILE_PATH]) then
return false
end
-- creo aree
ConvertTableToGeometry( WinTable[JWD_AREA .. 1], GDB_ID.ROOT)
return true
end
-- funzione che dato un progetto gerarchico lo scrive in json su un file
function WinManageProject.WriteToFile( nFrameId, sFilePath)
local sFilePath = EgtChangePathExtension( sFilePath, JWD_EXT)
local WinTable = WinManageProject.CreateTableFromGeom( nFrameId)
local sData = JSON:encode_pretty(WinTable)
local DestFh = io.open( sFilePath, 'w+')
if not DestFh then
EgtOutBox( 'Error opening ' .. sFilePath, 'WriteToFile', 'ERROR')
return
end
DestFh:write( sData)
DestFh:close()
end
-- funzione che dato un file in json ne crea il progetto gerarchico
function WinManageProject.ReadFromFile( sFilePath)
local SouFh = io.open( sFilePath, "rb")
if not SouFh then
EgtOutBox( 'Error opening ' .. sFilePath, 'ReadFromFile', 'ERROR')
return false
end
local content = SouFh:read( "*all")
SouFh:close()
local tData = JSON:decode( content)
if not WinManageProject.CreateGeomFromTable( tData) then
return false
end
return true
end
---------------------------------------------------------------------
return WinManageProject
-589
View File
@@ -1,589 +0,0 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by Egalware s.r.l.
-- Window project software by Egalware s.r.l. 2023/05/02
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
-- EgtEnableDebug( false)
-- Imposto direttorio per librerie
local sBaseDir = EgtGetSourceDir()
EgtOutLog("BaseDir=" .. sBaseDir)
EgtAddToPackagePath( sBaseDir .. '?.lua')
EgtAddToPackagePath( sBaseDir .. 'WinLib\\' .. '?.lua')
_G.package.loaded.WinConst = nil
require( 'WinConst')
_G.package.loaded.WinCreate = nil
local WinCreate = require( 'WinCreate')
_G.package.loaded.WinCalculate = nil
local WinCalculate = require( 'WinCalculate')
_G.package.loaded.WinManageProject = nil
local WinManageProject = require( 'WinManageProject')
------------------------------------------- PARAMETERS -------------------------------------------
local DebugCode = false
local HoleWidth = 1835
local HoleHeight = 1516
local WindowWidth = 1800
local WindowHeight = 1500
local WindowTree
local sProfilePath = 'c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge'
------------------------------------------- ************** -------------------------------------------
-- ciclo principale
EgtStartCounter()
EgtNewFile()
-- importo profilo prescelto
WinCreate.ImportProfile( sProfilePath)
local sFileName = ''
-- creo telaio rettangolare
sFileName = 'Rect_'
local FrameJointType = WIN_JNT.FULL_H
local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointType, FrameJointType, FrameJointType, FrameJointType)
-- -- creo telaio generico
-- sFileName = 'RoundArc_'
-- local nDrawFramePartId = EgtGroup( GDB_ID.ROOT)
-- EgtSetName( nDrawFramePartId, 'DrawFrame')
-- local nDrawFrameLayerId = EgtGroup( nDrawFramePartId)
-- local nFrameBottomId = EgtLine( nDrawFrameLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
-- local nFrameRightId = EgtLine( nDrawFrameLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
-- local nFrameTopId = EgtArc2PV( nDrawFrameLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0), Vector3d( 0, 1, 0))
-- --local nFrameTopId = EgtLine( nDrawFrameLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0))
-- local nFrameLeftId = EgtLine( nDrawFrameLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
-- local FrameJointType = WIN_JNT.FULL_H
-- local nFrameId = WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, FrameJointType, FrameJointType, FrameJointType, FrameJointType)
------------------------ Finestra vetro fisso ------------------------
-- sFileName = sFileName .. 'FixedGlass'
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- aggiungo vetro
-- local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
------------------------ Finestra vetro fisso con divisione orizzontale ------------------------
-- sFileName = sFileName .. 'FixedGlass_HorizontalSplit'
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra vetro fisso con divisione verticale ------------------------
-- sFileName = sFileName .. 'FixedGlass_VerticalSplit'
-- -- aggiungo zoccolo
-- WinCreate.AddBottomRail( nFrameId)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra vetro fisso con divisione orizzontale e verticale ------------------------
--sFileName = sFileName .. 'FixedGlass_Vertical&HorizontalSplit'
--
---- aggiungo zoccolo
--WinCreate.AddBottomRail( nFrameId)
--
---- definisco divisioni
--local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
--local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
--local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
--
---- aggiungo vetri
--local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
--local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
--local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
--local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola ------------------------
-- sFileName = sFileName .. 'Sash'
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione orizzontale ------------------------
-- sFileName = sFileName .. 'Sash_HorizontalSplit'
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione verticale ------------------------
-- sFileName = sFileName .. 'Sash_VerticalSplit'
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra anta singola con divisione orizzontale e verticale ------------------------
-- sFileName = sFileName .. 'Sash_Vertical&HorizontalSplit'
-- -- aggiungo anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco divisioni
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- aggiungo vetri
-- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra doppia anta con montante verticale ------------------------
-- sFileName = sFileName .. 'DoubleVerticalSash_Mullion'
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra doppia anta battente ricevente ------------------------
-- sFileName = sFileName .. 'DoubleVerticalSash_French'
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra doppia anta con montante orizzontale ------------------------
--sFileName = sFileName .. 'DoubleHorizontalSash_Mullion'
--
---- definisco prima divisione
--local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
--
---- aggiungo prima anta
--local SashJointType = WIN_JNT.FULL_V
--local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
--
---- aggiungo vetro
--local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
--
---- aggiungo seconda anta
--local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
--
---- aggiungo vetro
--local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montanti verticali ------------------------
-- sFileName = sFileName .. 'TripleVerticalSash_Mullion'
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montante verticale e ante battente e ricevente ------------------------
-- sFileName = sFileName .. 'TripleVerticalSash_Mullion&French'
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montanti orizzontali ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tripla anta con montante orizzontale e verticale ------------------------
--sFileName = sFileName .. 'TripleVertical&HorizontalSash_Mullion'
--
---- definisco prima divisione
--local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
--
---- definisco seconda divisione
--local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
--
---- aggiungo prima anta
--local SashJointType = WIN_JNT.FULL_V
--local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
---- aggiungo vetro
--local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
--
---- aggiungo seconda anta
--local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
---- aggiungo vetro
--local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
--
---- aggiungo terza anta
--local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
---- aggiungo vetro
--local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra sei ante con montanti verticali e orizzontale ------------------------
-- sFileName = sFileName .. 'SixSash_Vertical&HorizontalMullion'
-- -- definisco divisione orizzontale
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- definisco divisioni verticali
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quarta anta
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quinta anta
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo sesta anta
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra sei ante con montanti verticale e orizzontali ------------------------
sFileName = sFileName .. 'SixSash_Vertical&HorizontalMullion2'
-- definisco divisioni verticali
local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- definisco divisione orizzontali
local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
local nArea31Id, nArea32Id = WinCreate.AddSplit( nArea3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- aggiungo prima anta
local SashJointType = WIN_JNT.FULL_V
local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- aggiungo seconda anta
local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- aggiungo terza anta
local nSash3Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- aggiungo quarta anta
local nSash4Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- aggiungo quinta anta
local nSash5Id = WinCreate.AddSash( nArea31Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- aggiungo sesta anta
local nSash6Id = WinCreate.AddSash( nArea32Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- aggiungo vetro
local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra sei ante con montante verticale e orizzontale ed ante battente ricevente ------------------------
-- -- definisco divisione orizzontale
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
-- -- definisco divisioni verticali
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quarta anta
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- aggiungo vetro
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo quinta anta
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- aggiungo vetro
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo sesta anta
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetro
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tre ante con montante verticale, ante battente ricevente e split di tutte le ante ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco divisione
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- definisco divisione
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- definisco divisione
-- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill31Id = WinCreate.AddFill( nArea31Id, WIN_FILLTYPES.GLASS)
-- local nFill32Id = WinCreate.AddFill( nArea32Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra tre ante con montante orizzontale e verticale, ante battente ricevente e split di tutte le ante ------------------------
-- -- definisco prima divisione
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight)
-- -- definisco prima divisione
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
-- -- definisco seconda divisione
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
-- -- aggiungo anta sopra
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash0Id = WinCreate.AddSash( nArea0Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- aggiungo vetri
-- local nFill0Id = WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo prima anta
-- local SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
-- -- definisco divisione
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
-- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo seconda anta
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
-- -- definisco divisione
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
-- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- definisco divisione
-- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
-- -- aggiungo vetri
-- local nFill31Id = WinCreate.AddFill( nArea31Id, WIN_FILLTYPES.GLASS)
-- local nFill32Id = WinCreate.AddFill( nArea32Id, WIN_FILLTYPES.GLASS)
-----------------------------------------------------------------------------------
-- imposto se calcolare i solidi o meno
WinCalculate.SetCalcSolid( true)
-- creo i pezzi
local nFrameId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREAASTERISK)
WinCalculate.CreatePartFromArea( nFrameId)
-- salvo progetto su file
local sSaveDirPath = 'c:\\EgtData\\EgwWindowLua\\Projects'
local sSaveFilePath = sSaveDirPath .. '\\' .. sFileName
WinManageProject.WriteToFile( nFrameId, sSaveFilePath)
EgtZoom( SCE_ZM.ALL)
-- riporto tempi di esecuzione
local sOut = string.format( ' ExecTime = %.2f ms', EgtStopCounter())
EgtOutLog( sOut)
@@ -1,66 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ],
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 750.0, 0.0 ],
"ptStart": [ 0.0, 750.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
@@ -1,68 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
},
"SashType": 2
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
},
"SashType": 1
},
"AreaType": 0
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ],
"Split": [ {
"CurveType": 256,
"ptEnd": [ 900.0, 1500.0, 0.0 ],
"ptStart": [ 900.0, 0.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
@@ -1,66 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ],
"Split": [ {
"CurveType": 256,
"ptEnd": [ 900.0, 1500.0, 0.0 ],
"ptStart": [ 900.0, 0.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
-34
View File
@@ -1,34 +0,0 @@
{
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 1,
"BottomRail": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
@@ -1,79 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"Area2": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 900.0, 750.0, 0.0 ],
"ptStart": [ 0.0, 750.0, 0.0 ]
} ]
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"Area2": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 750.0, 0.0 ],
"ptStart": [ 900.0, 750.0, 0.0 ]
} ]
},
"AreaType": 1,
"BottomRail": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ],
"Split": [ {
"CurveType": 256,
"ptEnd": [ 900.0, 1500.0, 0.0 ],
"ptStart": [ 900.0, 0.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
-42
View File
@@ -1,42 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
@@ -1,87 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"Area2": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 900.0, 750.0, 0.0 ],
"ptStart": [ 0.0, 750.0, 0.0 ]
} ]
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"Area2": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 750.0, 0.0 ],
"ptStart": [ 900.0, 750.0, 0.0 ]
} ]
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
},
"Split": [ {
"CurveType": 256,
"ptEnd": [ 900.0, 1500.0, 0.0 ],
"ptStart": [ 900.0, 0.0, 0.0 ]
} ]
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
@@ -1,162 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1200.0, 750.0, 0.0 ],
"ptStart": [ 1200.0, 0.0, 0.0 ]
} ]
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 600.0, 750.0, 0.0 ],
"ptStart": [ 600.0, 0.0, 0.0 ]
} ]
},
"Area2": {
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1200.0, 1500.0, 0.0 ],
"ptStart": [ 1200.0, 750.0, 0.0 ]
} ]
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 600.0, 1500.0, 0.0 ],
"ptStart": [ 600.0, 750.0, 0.0 ]
} ]
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ],
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 750.0, 0.0 ],
"ptStart": [ 0.0, 750.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}
@@ -1,162 +0,0 @@
{
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 600.0, 750.0, 0.0 ],
"ptStart": [ 0.0, 750.0, 0.0 ]
} ]
},
"Area2": {
"Area1": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1200.0, 750.0, 0.0 ],
"ptStart": [ 600.0, 750.0, 0.0 ]
} ]
},
"Area2": {
"Area1": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"Area2": {
"Area1": {
"Area1": {
"AreaType": 3,
"FillType": 1
},
"AreaType": 2,
"Joint": {
"JointBL": 3,
"JointBR": 3,
"JointTL": 3,
"JointTR": 3
}
},
"AreaType": 0
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 750.0, 0.0 ],
"ptStart": [ 1200.0, 750.0, 0.0 ]
} ]
},
"AreaType": 4,
"Split": [ {
"CurveType": 256,
"ptEnd": [ 1200.0, 1500.0, 0.0 ],
"ptStart": [ 1200.0, 0.0, 0.0 ]
} ]
},
"AreaType": 1,
"Joint": {
"JointBL": 2,
"JointBR": 2,
"JointTL": 2,
"JointTR": 2
},
"Outline": [ {
"CurveType": 256,
"ptEnd": [ 1800.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 1800.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 0.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 1500.0, 0.0 ],
"ptStart": [ 1800.0, 1500.0, 0.0 ]
}, {
"CurveType": 256,
"ptEnd": [ 0.0, 0.0, 0.0 ],
"ptStart": [ 0.0, 1500.0, 0.0 ]
} ],
"Split": [ {
"CurveType": 256,
"ptEnd": [ 600.0, 1500.0, 0.0 ],
"ptStart": [ 600.0, 0.0, 0.0 ]
} ]
},
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge"
}

Some files were not shown because too many files have changed in this diff Show More