commit
8bd6f757df
@ -1,88 +0,0 @@
|
||||
(psc-include '("dialog/dialog.lsp"))
|
||||
|
||||
(defun-q c:edithardware ( /
|
||||
hdw-table
|
||||
hdwlst
|
||||
current-hardware
|
||||
update-hardware
|
||||
data
|
||||
;; variables defined here for dialog-init
|
||||
defaults-file
|
||||
popup-keys
|
||||
dist-keys
|
||||
int-keys
|
||||
toggle-keys
|
||||
plain-string-keys
|
||||
default-actions
|
||||
dialog-ties
|
||||
sub-dialogs
|
||||
;; hook
|
||||
dialog-after-load
|
||||
dialog-save-action
|
||||
dialog-edit-box-action
|
||||
;; variables included here for scope,
|
||||
;; but not defined here directly
|
||||
extra-keys
|
||||
tile-actions
|
||||
)
|
||||
"Edits a hardware table entry in a fab drawing
|
||||
|
||||
Only the description is locked, to ensure items are present in the hardware database, so
|
||||
Quantity and Note can be edited without using the command."
|
||||
|
||||
;; fail early with no hardware table
|
||||
(if (not (setq hdw-table (get-table-by-title "Hardware")))
|
||||
(error "EDITHARDWARE: No hardware table found"))
|
||||
|
||||
(setq plain-string-keys '("qty" "desc")
|
||||
toggle-keys '("sl")
|
||||
hdwlst (read-csv "fab/hardware.csv")
|
||||
popup-keys (list (append '("category"
|
||||
"All")
|
||||
(uniquify (mapcar 'cadddr hdwlst)))
|
||||
'("hardware" . current-hardware)))
|
||||
|
||||
;; calculate value of hardware box
|
||||
(defun current-hardware ( / cat hlst)
|
||||
(setq cat (dialog-popup-val "category")
|
||||
hlst hdwlst)
|
||||
(if (= (get_tile "show_all") "0")
|
||||
(remove! 'hlst '(= (nth 2 x) "xtra")))
|
||||
(if (not (= cat "All"))
|
||||
(remove! 'hlst '(not (= (nth 3 x) cat))))
|
||||
(mapcar 'car hlst))
|
||||
|
||||
;; update hardware list box
|
||||
(defun update-hardware ( / )
|
||||
(dialog-popup-list-update "hardware")
|
||||
(update-description))
|
||||
|
||||
(defun update-description ( / )
|
||||
(set_tile "desc" (dialog-popup-val "hardware")))
|
||||
|
||||
(defun dialog-after-load ( / )
|
||||
(dialog-add-action "hardware" '(update-description))
|
||||
(update-description)
|
||||
(dialog-add-action "show_all" '(update-hardware))
|
||||
(dialog-add-action "category" '(update-hardware)))
|
||||
|
||||
;; overwrite to get untyped data
|
||||
(defun dialog-save-action ( / )
|
||||
(setq data (dialog-get-data nil))
|
||||
(tk '(if (= sl "1") (add-to-list 'data (list "note" "SL"))))
|
||||
;; remove extraneous keys
|
||||
(remove! 'data
|
||||
'(member (car x) '("material"
|
||||
"category"
|
||||
"sl")))
|
||||
(done_dialog 0))
|
||||
|
||||
;; undefine to stop error checking on empty tiles
|
||||
(defun dialog-edit-box-action (key string)
|
||||
nil)
|
||||
|
||||
(if (and (setq data (dialog-init "fab/hardware.dcl" "hardware" '(("sl" "1"))))
|
||||
(setq hdw-row (table-get-row hdw-table)))
|
||||
(hdw-table-set-row hdw-table hdw-row data)))
|
||||
(defun-r 'c:edithardware)
|
||||
|
@ -1,122 +0,0 @@
|
||||
(psc-include '("dialog/dialog.lsp"
|
||||
"fab/util.lsp"))
|
||||
|
||||
(defun-q c:editmaterial ( /
|
||||
mat-table
|
||||
matlst
|
||||
current-material
|
||||
update-material
|
||||
update-properties
|
||||
data
|
||||
;; variables defined here for dialog-init
|
||||
defaults-file
|
||||
popup-keys
|
||||
dist-keys
|
||||
int-keys
|
||||
toggle-keys
|
||||
plain-string-keys
|
||||
default-actions
|
||||
dialog-ties
|
||||
sub-dialogs
|
||||
;; hook
|
||||
dialog-after-load
|
||||
dialog-save-action
|
||||
dialog-edit-box-action
|
||||
;; variables included here for scope,
|
||||
;; but not defined here directly
|
||||
extra-keys
|
||||
tile-actions
|
||||
)
|
||||
"Edits a material table entry in a fab drawing
|
||||
|
||||
Only the Description and Weight columns are locked, to ensure items are present in the
|
||||
hardware database, so Quantity, Length, Width, and Note can be edited without using the
|
||||
command."
|
||||
;; fail early with no material table
|
||||
(if (not (setq mat-table (get-table-by-title "Material")))
|
||||
(error "EDITMATERIAL: No material table found"))
|
||||
|
||||
(setq toggle-keys '("sl" "lc")
|
||||
plain-string-keys '("mark" "desc")
|
||||
int-keys '("qty")
|
||||
dist-keys '("length" "width")
|
||||
default-actions '(("category" . update-material)
|
||||
("material" . update-properties))
|
||||
matlst (read-csv "fab/material.csv")
|
||||
popup-keys (list (append '("category"
|
||||
"All")
|
||||
(uniquify (mapcar '(lambda(x) (nth 4 x)) matlst)))
|
||||
'("material" . current-material)))
|
||||
|
||||
;; calculate value of material box
|
||||
(defun current-material ( / cat mlst)
|
||||
(setq cat (dialog-popup-val "category")
|
||||
mlst matlst)
|
||||
(if (= (get_tile "show_all") "0")
|
||||
(remove! 'mlst '(= (nth 3 x) "xtra")))
|
||||
(if (not (= cat "All"))
|
||||
(remove! 'mlst '(not (= (nth 4 x) cat))))
|
||||
(mapcar 'car mlst))
|
||||
|
||||
;; update material box list
|
||||
(defun update-material (key val / )
|
||||
(dialog-popup-list-update "material")
|
||||
(update-properties nil nil))
|
||||
|
||||
;; update properties based on selection in material box
|
||||
(defun update-properties (key val / desc wt-type)
|
||||
(setq desc (dialog-popup-val "material")
|
||||
wt-type (nth 2 (assoc desc matlst)))
|
||||
(set_tile "desc" desc)
|
||||
(cond ((= wt-type "sqft")
|
||||
(mode_tile "width" 0)
|
||||
(mode_tile "length" 0))
|
||||
((= wt-type "foot")
|
||||
(set_tile "width" "")
|
||||
(mode_tile "width" 1)
|
||||
(mode_tile "length" 0))
|
||||
((= wt-type "each")
|
||||
(set_tile "width" "")
|
||||
(mode_tile "width" 1)
|
||||
(set_tile "length" "")
|
||||
(mode_tile "length" 1))))
|
||||
|
||||
(defun dialog-after-load ( / )
|
||||
(dialog-add-action "show_all" '(update-material nil nil))
|
||||
(update-properties nil nil))
|
||||
|
||||
;; overwrite to get untyped data
|
||||
(defun dialog-save-action ( / note wt-type wt)
|
||||
(setq data (dialog-get-data nil))
|
||||
;; process notes
|
||||
(setq note (tk '(cond ((and (= sl "1")
|
||||
(= lc "1"))
|
||||
"SL,LC")
|
||||
((= sl "1") "SL")
|
||||
((= lc "1") "LC")
|
||||
(T nil))))
|
||||
(if note (add-to-list 'data (list "note" note)))
|
||||
;; determine weight formula
|
||||
(add-to-list 'data
|
||||
(list "weight" (tk '(calc-weight-formula desc))))
|
||||
;; remove extraneous keys
|
||||
(remove! 'data
|
||||
'(member (car x) '("category"
|
||||
"material"
|
||||
"sl"
|
||||
"lc")))
|
||||
(done_dialog 0))
|
||||
|
||||
;; undefine to stop error checking on empty tiles
|
||||
(defun dialog-edit-box-action (key string)
|
||||
nil)
|
||||
|
||||
((lambda(/ set-func)
|
||||
(setq set-func (if (= (get-custom-dwgprop "fab") "generic-ship-loose")
|
||||
gsl-mat-table-set-row
|
||||
mat-table-set-row))
|
||||
(if (and (setq data (dialog-init "fab/material.dcl" "material" nil))
|
||||
(setq mat-row (table-get-row mat-table)))
|
||||
(set-func mat-table mat-row data))))
|
||||
(princ))
|
||||
(defun-r 'c:editmaterial)
|
@ -0,0 +1,18 @@
|
||||
(psc-include '("dialog/dialog.lsp"
|
||||
"fab/util.lsp"))
|
||||
|
||||
(defun-q c:edittable (/ cell table title)
|
||||
"Edits the description of an item in a material or hardware table.
|
||||
|
||||
In a material table, this command also updates the item weight."
|
||||
(setq cell (get-table-cell))
|
||||
(if (not cell) (error "No table selected"))
|
||||
(setq table (pop! 'cell)
|
||||
title (table-get-title table)
|
||||
data (list
|
||||
(list "desc"
|
||||
(cond ((ends-with title "Material") (get-material))
|
||||
((ends-with title "Hardware") (get-hardware))))))
|
||||
(table-set-row table (car cell) data)
|
||||
(table--decimal-format-cell table (car cell) (vl-position "weight" (table-get-column-names table))))
|
||||
(defun-r 'c:edittable)
|
@ -1,60 +1,21 @@
|
||||
(setq *insertrows-title* "Material"
|
||||
*insertrows-nrows* 1
|
||||
*insertrows-where* "Before")
|
||||
(setq *insertrows-nrows* 1)
|
||||
|
||||
(defun-q c:insertrows (/
|
||||
title
|
||||
table
|
||||
where
|
||||
nrows
|
||||
table-nrows
|
||||
mt
|
||||
ht
|
||||
insrow
|
||||
row-ht
|
||||
gsl-p
|
||||
match-last-p
|
||||
)
|
||||
(defun-q c:insertrows (/ cell table)
|
||||
"Inserts rows in a fab drawing table
|
||||
|
||||
This command works on the material, hardware, and assembly tables. The tables below the
|
||||
one you choose will be shifted to accommodate the new rows.
|
||||
In a generic fab drawing, the tables below the one you choose will be shifted to
|
||||
accommodate the new rows.
|
||||
|
||||
If inserting rows in the material list above an existing standard-prefix part (i.e. not
|
||||
pans, STN, QT, or NRT), the mark numbers for parts below will be increased by the number
|
||||
of rows added. This carries to the callouts in the drawing as well.
|
||||
If inserting rows in the material list above an existing standard-prefix part (e.g. AA;
|
||||
i.e. not pans, STN, QT, or NRT), the mark numbers for parts below will be increased by the
|
||||
number of rows added. This carries to the callouts in the drawing as well.
|
||||
|
||||
If inserting rows in the assembly table, the quantities in the material table will be
|
||||
updated."
|
||||
(setq title (getdkword '(0 "Material Hardware Assembly matchLast") '*insertrows-title* "Table?")
|
||||
table (get-table-by-title (strcat title "*")))
|
||||
(if (not table) (error "Table not found"))
|
||||
(setq nrows (getdint '*insertrows-nrows* "Number of rows to add")
|
||||
gsl-p (= (get-custom-dwgprop "fab") "generic-ship-loose")
|
||||
where (getdkword '(0 "End Before") '*insertrows-where* "Where?")
|
||||
where (if (= where "Before")
|
||||
(table-get-row table)
|
||||
(if (and (= title "Material")
|
||||
(not gsl-p))
|
||||
(1- (vla-get-Rows table))
|
||||
(vla-get-Rows table)))
|
||||
row-ht (vla-GetRowHeight table 0))
|
||||
|
||||
(if (and (= title "Material")
|
||||
(not gsl-p))
|
||||
(mat-table-update-marks + nrows where))
|
||||
(table-insert-rows table nrows where)
|
||||
|
||||
;; update material list quantities and each weight
|
||||
(if (and (= title "Assembly")
|
||||
(setq mt (get-table-by-title "Material"))
|
||||
(setq ht (get-table-by-title "Hardware")))
|
||||
(progn
|
||||
(setq table-nrows (vla-get-Rows table))
|
||||
(table-divide-qty mt 1 (- table-nrows nrows 2))
|
||||
(table-divide-qty ht 0 (- table-nrows nrows 2))
|
||||
(table-multiply-qty mt 1 (- table-nrows 2))
|
||||
(table-multiply-qty ht 0 (- table-nrows 2))
|
||||
(mat-table-update-ea-wt mt)))
|
||||
(setq cell (get-table-cell))
|
||||
(if (not cell)
|
||||
(error "No table cell selected"))
|
||||
(setq table (pop! 'cell))
|
||||
(table-insert-rows table (getdint '*insertrows-nrows* "Number of rows to add") (car cell))
|
||||
(princ))
|
||||
(defun-r 'c:insertrows)
|
||||
|
@ -1,81 +1,18 @@
|
||||
(setq *trimrows-title* "Material"
|
||||
*trimrows-where* "Before")
|
||||
|
||||
(defun-q c:trimrows ( /
|
||||
table
|
||||
title
|
||||
where
|
||||
tbls2move
|
||||
row-ht
|
||||
lastrow
|
||||
mt
|
||||
ht
|
||||
table-nrows
|
||||
)
|
||||
(defun-q c:trimrows ( / cell table)
|
||||
"Trims empty rows from a fab drawing table
|
||||
|
||||
A row is considered empty if its first column is blank.
|
||||
|
||||
This command works on the material, hardware, and assembly tables. The tables below the
|
||||
one you choose will be shifted to accommodate the removed rows.
|
||||
|
||||
If trimming rows from the material list above an existing standard-prefix part (i.e. not
|
||||
pans, STN, QT, or NRT), the mark numbers for parts below will be decreased by the number
|
||||
of rows removed. This carries to the callouts in the drawing as well.
|
||||
If inserting rows in the material list above an existing standard-prefix part (e.g. AA;
|
||||
i.e. not pans, STN, QT, or NRT), the mark numbers for parts below will be increased by the
|
||||
number of rows added. This carries to the callouts in the drawing as well.
|
||||
|
||||
If trimming rows from the assembly table, the quantities in the material table will be
|
||||
If trimming rows in the assembly table, the quantities in the material table will be
|
||||
updated."
|
||||
(setq title (getdkword '(0 "Material Hardware Assembly") '*trimrows-title* "Table?")
|
||||
table (get-table-by-title (strcat title "*")))
|
||||
(if (not table) (error "Table not found"))
|
||||
(setq where (getdkword '(0 "End Before") '*trimrows-where* "Where?")
|
||||
row-ht (vla-GetRowHeight table 0)
|
||||
gsl-p (= (get-custom-dwgprop "fab") "generic-ship-loose"))
|
||||
|
||||
(cond ((= title "Material")
|
||||
(setq tbls2move (mapcar 'get-table-by-title '("Hardware"
|
||||
"Assembly*"
|
||||
"Finish"))
|
||||
lastrow (if (= where "End")
|
||||
(- (vla-get-Rows table) (if gsl-p 0 1))
|
||||
(table-get-row table))))
|
||||
((= title "Hardware")
|
||||
(setq tbls2move (mapcar 'get-table-by-title '("Assembly*"
|
||||
"Finish"))
|
||||
lastrow (if (= where "End")
|
||||
(vla-get-Rows table)
|
||||
(table-get-row table))))
|
||||
((= title "Assembly")
|
||||
(setq tbls2move (list (get-table-by-title "Finish"))
|
||||
lastrow (if (= where "End")
|
||||
(vla-get-Rows table)
|
||||
(table-get-row table)))))
|
||||
|
||||
(setq nrows 0)
|
||||
(while (= (vla-GetText table (dec! 'lastrow) (if gsl-p 4 0)) "")
|
||||
(inc! 'nrows))
|
||||
(inc! 'lastrow)
|
||||
(if (and (= title "Material")
|
||||
(not gsl-p))
|
||||
(mat-table-update-marks - nrows lastrow))
|
||||
(if (> nrows 0)
|
||||
(vla-DeleteRows table lastrow nrows))
|
||||
|
||||
;; update material list weights if there is a material table
|
||||
(if (and (= title "Assembly")
|
||||
(setq mt (get-table-by-title "Material"))
|
||||
(setq ht (get-table-by-title "Hardware")))
|
||||
(progn
|
||||
(setq table-nrows (vla-get-Rows table))
|
||||
(table-divide-qty mt 1 (+ (- table-nrows 2) nrows))
|
||||
(table-divide-qty ht 0 (+ (- table-nrows 2) nrows))
|
||||
(table-multiply-qty mt 1 (- table-nrows 2))
|
||||
(table-multiply-qty ht 0 (- table-nrows 2))
|
||||
(mat-table-update-ea-wt mt)))
|
||||
|
||||
(foreach tbl tbls2move
|
||||
(if tbl (vla-Move tbl
|
||||
(vlax-3d-point 0 0 0)
|
||||
(vlax-3d-point 0 (* row-ht nrows) 0))))
|
||||
(setq cell (get-table-cell))
|
||||
(if (not cell)
|
||||
(error "No table cell selected"))
|
||||
(setq table (pop! 'cell))
|
||||
(table-trim-empty-rows table (car cell))
|
||||
(princ))
|
||||
(defun-r 'c:trimrows)
|
||||
|
@ -0,0 +1,62 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>fab/land-hanger.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>fab/land-hanger.lsp <a href="../../fab/land-hanger.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc">Functions for calculating landing hanger fabs</pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-hanger.html#land-hanger-calc">(<span class="funcname">land-hanger-calc</span> corner)</a></td>
|
||||
<td>Calculates the hanger material and hardware for this CORNER of the current landing</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-hanger.html#land-hanger-p">(<span class="funcname">land-hanger-p</span> corner)</a></td>
|
||||
<td>Returns T if there is a hanger at this corner</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="land-hanger-calc" class="funcsig">(<span class="funcname">land-hanger-calc</span> corner)</h3>
|
||||
<pre class="fulldoc">Calculates the hanger material and hardware for this CORNER of the current landing
|
||||
|
||||
Assumed to be called by <a href="fab-land-ship-loose.html#land-sl--calc">land-sl--calc</a>
|
||||
|
||||
VARS:
|
||||
(CORNER STR (MEMBER CORNER '("fl" "fr" "bl" "br")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-hanger-p" class="funcsig">(<span class="funcname">land-hanger-p</span> corner)</h3>
|
||||
<pre class="fulldoc">Returns T if there is a hanger at this corner
|
||||
|
||||
VARS:
|
||||
(CORNER STR (MEMBER CORNER '("fl" "fr" "bl" "br")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,62 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>fab/land-ledger.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>fab/land-ledger.lsp <a href="../../fab/land-ledger.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc">Functions for making landing ledger fabs</pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-ledger.html#land-ledger-calc">(<span class="funcname">land-ledger-calc</span> corner)</a></td>
|
||||
<td>Calculates the ledger material and hardware for this CORNER of the current landing</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-ledger.html#land-ledger-p">(<span class="funcname">land-ledger-p</span> corner)</a></td>
|
||||
<td>Returns T if there is a ledger at this corner</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="land-ledger-calc" class="funcsig">(<span class="funcname">land-ledger-calc</span> corner)</h3>
|
||||
<pre class="fulldoc">Calculates the ledger material and hardware for this CORNER of the current landing
|
||||
|
||||
Assumed to be called by <a href="fab-land-ship-loose.html#land-sl--calc">land-sl--calc</a>
|
||||
|
||||
VARS:
|
||||
(CORNER STR (MEMBER CORNER '("fl" "fr" "bl" "br")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-ledger-p" class="funcsig">(<span class="funcname">land-ledger-p</span> corner)</h3>
|
||||
<pre class="fulldoc">Returns T if there is a ledger at this corner
|
||||
|
||||
VARS:
|
||||
(CORNER STR (MEMBER CORNER '("fl" "fr" "bl" "br")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,82 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>fab/land-post.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>fab/land-post.lsp <a href="../../fab/land-post.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc">Functions for calculating landing post fabs</pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr><td colspan="3">Public</td></tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-post.html#land-post-calc">(<span class="funcname">land-post-calc</span> corner)</a></td>
|
||||
<td>Calculates the post material and hardware for this CORNER of the current landing</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-post.html#land-post-p">(<span class="funcname">land-post-p</span> corner)</a></td>
|
||||
<td>Returns T if there is a post at this corner</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr><td colspan="3">Private</td></tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-post.html#land-post--xbrace-material">(<span class="funcname">land-post--xbrace-material</span> bay)</a></td>
|
||||
<td>Return the material for X-bracing at BAY</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="land-post-calc" class="funcsig">(<span class="funcname">land-post-calc</span> corner)</h3>
|
||||
<pre class="fulldoc">Calculates the post material and hardware for this CORNER of the current landing
|
||||
|
||||
Assumed to be called by <a href="fab-land-ship-loose.html#land-sl--calc">land-sl--calc</a>
|
||||
|
||||
VARS:
|
||||
(CORNER STR (MEMBER CORNER '("fl" "fr" "bl" "br")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-post-p" class="funcsig">(<span class="funcname">land-post-p</span> corner)</h3>
|
||||
<pre class="fulldoc">Returns T if there is a post at this corner
|
||||
|
||||
VARS:
|
||||
(CORNER STR (MEMBER CORNER '("fl" "fr" "bl" "br")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-post--xbrace-material" class="funcsig">(<span class="funcname">land-post--xbrace-material</span> bay)</h3>
|
||||
<pre class="fulldoc">Return the material for X-bracing at BAY
|
||||
|
||||
VARS:
|
||||
(BAY STR (MEMBER BAY '("f" "b" "l" "r")))
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,98 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>fab/land-ship-loose.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>fab/land-ship-loose.lsp <a href="../../fab/land-ship-loose.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc">Functions for ship loose landing fabs
|
||||
|
||||
New ship loose piece types should be added to LAND-SL--FAB-TYPES</pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr><td colspan="3">Public</td></tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-ship-loose.html#land-sl-make-fabs">(<span class="funcname">land-sl-make-fabs</span> lands fab-type)</a></td>
|
||||
<td>Makes ship loose landing fabs of type FAB-TYPE for LANDS</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr><td colspan="3">Private</td></tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-ship-loose.html#land-sl--calc">(<span class="funcname">land-sl--calc</span> fab-type land-data)</a></td>
|
||||
<td>Calculates ship loose pieces for a landing</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-ship-loose.html#land-sl--calc-dwg-no">(<span class="funcname">land-sl--calc-dwg-no</span> jobno stairno)</a></td>
|
||||
<td>Returns the next available ship loose drawing number</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-land-ship-loose.html#land-sl--make-fab">(<span class="funcname">land-sl--make-fab</span> fab-type finish material hardware)</a></td>
|
||||
<td>Makes a ship loose landing fab of FAB-TYPE</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="land-sl-make-fabs" class="funcsig">(<span class="funcname">land-sl-make-fabs</span> lands fab-type)</h3>
|
||||
<pre class="fulldoc">Makes ship loose landing fabs of type FAB-TYPE for LANDS
|
||||
|
||||
VARS:
|
||||
(LANDS LIST (VL-EVERY 'DATA-LIST-P LANDS))
|
||||
(FAB-TYPE STR (MEMBER FAB-TYPE LAND-SL--FAB-TYPES))</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-sl--calc" class="funcsig">(<span class="funcname">land-sl--calc</span> fab-type land-data)</h3>
|
||||
<pre class="fulldoc">Calculates ship loose pieces for a landing
|
||||
|
||||
Returns a list of lists whose car is the finish and cadr is a 2-element list. The elements
|
||||
are datalists of material and hardware, respectively.
|
||||
|
||||
VARS:
|
||||
(FAB-TYPE STR (MEMBER FAB-TYPE LAND-SL--FAB-TYPES))
|
||||
(LAND-DATA LIST (DATA-LIST-P LAND-DATA))</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-sl--calc-dwg-no" class="funcsig">(<span class="funcname">land-sl--calc-dwg-no</span> jobno stairno)</h3>
|
||||
<pre class="fulldoc">Returns the next available ship loose drawing number
|
||||
|
||||
VARS:
|
||||
(JOBNO STR)
|
||||
(STAIRNO STR)</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="land-sl--make-fab" class="funcsig">(<span class="funcname">land-sl--make-fab</span> fab-type finish material hardware)</h3>
|
||||
<pre class="fulldoc">Makes a ship loose landing fab of FAB-TYPE
|
||||
|
||||
VARS:
|
||||
(FAB-TYPE STR (MEMBER FAB-TYPE LAND-SL--FAB-TYPES))
|
||||
(FINISH STR)
|
||||
(MATERIAL LIST (VL-EVERY 'DATA-LIST-P MATERIAL))
|
||||
(HARDWARE LIST (VL-EVERY 'DATA-LIST-P HARDWARE))</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,141 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>fab/stair-rail.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>fab/stair-rail.lsp <a href="../../fab/stair-rail.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc">Functions for stair rail fabs</pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#calc-stair-rail-dloop">(<span class="funcname">calc-stair-rail-dloop</span> side)</a></td>
|
||||
<td>Returns a 1-2 item list of returns for this rail</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#calc-stair-rail-dloops">(<span class="funcname">calc-stair-rail-dloops</span> stairs)</a></td>
|
||||
<td>Returns a list of D-loops</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#calc-stair-rail-fab">(<span class="funcname">calc-stair-rail-fab</span> stair-data)</a></td>
|
||||
<td>Returns a list of 0-2 stair rail definitions for a stair</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#combine-stair-rail-dloops">(<span class="funcname">combine-stair-rail-dloops</span> d-loops)</a></td>
|
||||
<td>Returns D-LOOPS combined based on finish</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#combine-stair-rail-fabs">(<span class="funcname">combine-stair-rail-fabs</span> rail-datas)</a></td>
|
||||
<td>Combines RAIL-DATAS based on template and finish</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#make-stair-rail-dloop-fabs">(<span class="funcname">make-stair-rail-dloop-fabs</span> stairs)</a></td>
|
||||
<td>Calls <a href="fab-stair-rail.html#combine-stair-rail-dloops">combine-stair-rail-dloops</a> and makes D-loop drawings</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#make-stair-rail-fab">(<span class="funcname">make-stair-rail-fab</span> template finish rail-datas)</a></td>
|
||||
<td>Opens TEMPLATE and creates a standard stair rail fab drawing</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#make-stair-rail-fabs">(<span class="funcname">make-stair-rail-fabs</span> stairs)</a></td>
|
||||
<td>Bundles rails and calls <a href="fab-stair-rail.html#make-stair-rail-fab">make-stair-rail-fab</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#stair-rail-dloop-write-table">(<span class="funcname">stair-rail-dloop-write-table</span> finish d-loop-datas)</a></td>
|
||||
<td>Writes the D-loop table</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-stair-rail.html#stair-rail-write-table">(<span class="funcname">stair-rail-write-table</span> finish rail-datas)</a></td>
|
||||
<td>Writes the table in a stair rail fab drawing</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="calc-stair-rail-dloop" class="funcsig">(<span class="funcname">calc-stair-rail-dloop</span> side)</h3>
|
||||
<pre class="fulldoc">Returns a 1-2 item list of returns for this rail
|
||||
|
||||
VARS:
|
||||
(SIDE STR)
|
||||
|
||||
WITH-DATA</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="calc-stair-rail-dloops" class="funcsig">(<span class="funcname">calc-stair-rail-dloops</span> stairs)</h3>
|
||||
<pre class="fulldoc">Returns a list of D-loops</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="calc-stair-rail-fab" class="funcsig">(<span class="funcname">calc-stair-rail-fab</span> stair-data)</h3>
|
||||
<pre class="fulldoc">Returns a list of 0-2 stair rail definitions for a stair
|
||||
|
||||
VARS:
|
||||
(STAIR-DATA LIST (DATA-LIST-P STAIR-DATA))</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="combine-stair-rail-dloops" class="funcsig">(<span class="funcname">combine-stair-rail-dloops</span> d-loops)</h3>
|
||||
<pre class="fulldoc">Returns D-LOOPS combined based on finish</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="combine-stair-rail-fabs" class="funcsig">(<span class="funcname">combine-stair-rail-fabs</span> rail-datas)</h3>
|
||||
<pre class="fulldoc">Combines RAIL-DATAS based on template and finish
|
||||
|
||||
VARS:
|
||||
(RAIL-DATAS LIST (VL-EVERY 'DATA-LIST-P RAIL-DATAS))</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="make-stair-rail-dloop-fabs" class="funcsig">(<span class="funcname">make-stair-rail-dloop-fabs</span> stairs)</h3>
|
||||
<pre class="fulldoc">Calls <a href="fab-stair-rail.html#combine-stair-rail-dloops">combine-stair-rail-dloops</a> and makes D-loop drawings</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="make-stair-rail-fab" class="funcsig">(<span class="funcname">make-stair-rail-fab</span> template finish rail-datas)</h3>
|
||||
<pre class="fulldoc">Opens TEMPLATE and creates a standard stair rail fab drawing</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="make-stair-rail-fabs" class="funcsig">(<span class="funcname">make-stair-rail-fabs</span> stairs)</h3>
|
||||
<pre class="fulldoc">Bundles rails and calls <a href="fab-stair-rail.html#make-stair-rail-fab">make-stair-rail-fab</a></pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="stair-rail-dloop-write-table" class="funcsig">(<span class="funcname">stair-rail-dloop-write-table</span> finish d-loop-datas)</h3>
|
||||
<pre class="fulldoc">Writes the D-loop table</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="stair-rail-write-table" class="funcsig">(<span class="funcname">stair-rail-write-table</span> finish rail-datas)</h3>
|
||||
<pre class="fulldoc">Writes the table in a stair rail fab drawing</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,80 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>fab/wall-rail.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>fab/wall-rail.lsp <a href="../../fab/wall-rail.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc">Functions for wall rail fabs</pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-wall-rail.html#calc-wall-rail-fab">(<span class="funcname">calc-wall-rail-fab</span> stair-data)</a></td>
|
||||
<td>Return a list of wall rail definitions</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-wall-rail.html#combine-wall-rail-fabs">(<span class="funcname">combine-wall-rail-fabs</span> rail-datas)</a></td>
|
||||
<td>Combine rail-datas based on template and finish</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-wall-rail.html#make-wall-rail-fabs">(<span class="funcname">make-wall-rail-fabs</span> stairs)</a></td>
|
||||
<td>Bundle rails and call make-wall-rail-fab</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-wall-rail.html#make-wall-rail-std-fab">(<span class="funcname">make-wall-rail-std-fab</span> template finish rails)</a></td>
|
||||
<td>Open template and call <a href="fab-wall-rail.html#wall-rail-write-table">wall-rail-write-table</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="fab-wall-rail.html#wall-rail-write-table">(<span class="funcname">wall-rail-write-table</span> finish rail-datas)</a></td>
|
||||
<td>Write the table in a wall rail fab drawing</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="calc-wall-rail-fab" class="funcsig">(<span class="funcname">calc-wall-rail-fab</span> stair-data)</h3>
|
||||
<pre class="fulldoc">Return a list of wall rail definitions</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="combine-wall-rail-fabs" class="funcsig">(<span class="funcname">combine-wall-rail-fabs</span> rail-datas)</h3>
|
||||
<pre class="fulldoc">Combine rail-datas based on template and finish</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="make-wall-rail-fabs" class="funcsig">(<span class="funcname">make-wall-rail-fabs</span> stairs)</h3>
|
||||
<pre class="fulldoc">Bundle rails and call make-wall-rail-fab</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="make-wall-rail-std-fab" class="funcsig">(<span class="funcname">make-wall-rail-std-fab</span> template finish rails)</h3>
|
||||
<pre class="fulldoc">Open template and call <a href="fab-wall-rail.html#wall-rail-write-table">wall-rail-write-table</a></pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="wall-rail-write-table" class="funcsig">(<span class="funcname">wall-rail-write-table</span> finish rail-datas)</h3>
|
||||
<pre class="fulldoc">Write the table in a wall rail fab drawing</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,50 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>rail/guard-rail.lsp | PSC Code Manual</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="./index.html">PSC Code Manual</a></h1>
|
||||
<div id="content">
|
||||
|
||||
<h2>rail/guard-rail.lsp <a href="../../rail/guard-rail.lsp">[src]</a></h2>
|
||||
<pre class="fulldoc"></pre>
|
||||
<table>
|
||||
<thead>
|
||||
<h3>Functions</h3>
|
||||
<th>Function signature</th>
|
||||
<th>Description</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="rail-guard-rail.html#multi-guard">(<span class="funcname">multi-guard</span> delta)</a></td>
|
||||
<td>Passes data from multiple guards to single-guard process</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="funcsig"><a href="rail-guard-rail.html#single-guard">(<span class="funcname">single-guard</span>)</a></td>
|
||||
<td>Processes to draw single guard</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="multi-guard" class="funcsig">(<span class="funcname">multi-guard</span> delta)</h3>
|
||||
<pre class="fulldoc">Passes data from multiple guards to single-guard process</pre>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="single-guard" class="funcsig">(<span class="funcname">single-guard</span>)</h3>
|
||||
<pre class="fulldoc">Processes to draw single guard</pre>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,32 @@
|
||||
* Misc
|
||||
- all cells fully unlocked (all table types)
|
||||
- Finish isn't a proper table type; more like an entity of its own kind
|
||||
- no header row
|
||||
- only interaction w/ other tables is to be shifted
|
||||
* Table types
|
||||
- *Material :: either kind of material list
|
||||
- description and weight edited by EDITTABLE
|
||||
|
||||
- Material :: generic material list
|
||||
- must have Assembly*
|
||||
- qty must be a multiple of Assembly* rows
|
||||
- moves Hardware, Assembly*, Finish
|
||||
- has weight summary row
|
||||
- total weight updated by INSERTROWS/TRIMROWS @ self
|
||||
- each weight updated by INSERTROWS/TRIMROWS @ Assembly*
|
||||
|
||||
- Misc Material :: ship loose material list
|
||||
- assemblies inline
|
||||
- piece type, stair, level, sequence
|
||||
- doesn't move anything
|
||||
|
||||
- *Hardware :: either kind of hardware list
|
||||
- description edited by EDITTABLE
|
||||
|
||||
- Hardware :: generic hardware list
|
||||
- must have Assembly*
|
||||
- qty must be a multiple of Assembly* rows
|
||||
- moves Assembly*, Finish
|
||||
|
||||
- Misc Hardware :: ship loose material list
|
||||
- doesn't move anything
|
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,663 +1,210 @@
|
||||
(set-file-docstring "Support functions for FABDATA")
|
||||
(set-file-docstring "Support functions for FABDATA
|
||||
|
||||
(defun-q fabdata-combine (lst / ret found-match-p)
|
||||
"Combines identical line items in main fabdata"
|
||||
(setq ret (list (pop! 'lst)))
|
||||
(while lst
|
||||
(foreach idx (range 0 (length ret) 1)
|
||||
(if (not found-match-p)
|
||||
(if (vl-every '= (slice (nth idx ret) 0 16) (slice (car lst) 0 16))
|
||||
(setq found-match-p T
|
||||
ret
|
||||
(append
|
||||
(slice ret 0 idx)
|
||||
((lambda(/ l1 l2)
|
||||
(setq l1 (reverse (nth idx ret))
|
||||
l2 (reverse (pop! 'lst)))
|
||||
(list
|
||||
(reverse
|
||||
(cons (to-string (+ (read (car l1)) (read (car l2))))
|
||||
(cdr l1))))))
|
||||
(slice ret (1+ idx) (length ret)))))))
|
||||
(if (not found-match-p)
|
||||
(add-to-list 'ret (pop! 'lst)))
|
||||
(setq found-match-p nil))
|
||||
(mapcar
|
||||
'(lambda(row)
|
||||
(mapcar '(lambda(cell) (if (= (read cell) 0) "O" cell)) row))
|
||||
ret))
|
||||
(defun-r 'fabdata-combine)
|
||||
For scoping, every function here expects to be called by %fabdata-process-dwgs")
|
||||
|
||||
(psc-include '("fab/util.lsp"))
|
||||
|
||||
(defun-q fabdata-process-dwgs (files
|
||||
/ data job-info jobno hdwlst sl-hdw stairno filename
|
||||
cnt>str skipped-dwgs)
|
||||
"Processes all FILES for fab data information and writes it to a .csv"
|
||||
(setq job-info (get-job-info)
|
||||
jobno (xd-value "number" job-info)
|
||||
ret (strip-nil (map-append 'fabdata-process-dwg files))
|
||||
hdwlst (read-csv "fab/hardware.csv")
|
||||
sl-hdw (count-items sl-hdw)
|
||||
sl-hdw (mapcar '(lambda(x)
|
||||
(list
|
||||
(xd-value "number" job-info)
|
||||
""
|
||||
stairno
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
(?s (nth 1 (assoc (car x) hdwlst)))
|
||||
(car x)
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
(to-string (cadr x))))
|
||||
sl-hdw)
|
||||
ret (append (strip-nil (fabdata-combine ret)) sl-hdw))
|
||||
;; transform the result of count-items into a CSV list
|
||||
(defun cnt>str (lst)
|
||||
(vl-sort (mapcar '(lambda(x) (mapcar 'to-string
|
||||
(append (car x) (cdr x))))
|
||||
lst)
|
||||
(sort-by 'cadr '<)))
|
||||
;; main fabdata
|
||||
/ jobno matlst material hdwlst hardware assemblies stairno)
|
||||
"Processes all FILES using %fabdata--process-dwg and writes result to a .csv"
|
||||
(declare (vars (files list (vl-every 'stringp files))))
|
||||
(setq jobno (xd-value "number" (get-job-info))
|
||||
matlst (read-csv "fab/material.csv")
|
||||
hdwlst (read-csv "fab/hardware.csv"))
|
||||
(foreach file files (fabdata--process-dwg file))
|
||||
(if hardware
|
||||
(setq hardware (mapcar '(lambda(hdw)
|
||||
(list
|
||||
jobno
|
||||
""
|
||||
stairno
|
||||
"" "" "" ""
|
||||
(xd-value "hdw_code" hdw)
|
||||
(xd-value "desc" hdw)
|
||||
"" "" "" "" "" "" ""
|
||||
(xd-value "qty" hdw)))
|
||||
(combine-like-data hardware '("desc" "hdw_code") nil))))
|
||||
(setq ret (append assemblies material hardware))
|
||||
(debug-print-vars '(assemblies material hardware))
|
||||
(if ret
|
||||
(progn
|
||||
(setq filename (strcat (vla-get-Path acadDoc)
|
||||
"/"
|
||||
(xd-value "number" job-info)
|
||||
" stair "
|
||||
stairno
|
||||
" "))
|
||||
(write-csv ret (strcat filename "fabdata.csv") T)))
|
||||
(if skipped-dwgs
|
||||
(alert (strcat "The following drawings had no fab DWGPROP and were skipped:\n"
|
||||
(strjoin skipped-dwgs "\n")))))
|
||||
(write-csv ret (strcat (vla-get-Path acadDoc) "/" jobno " stair " stairno " fabdata.csv") T)))
|
||||
(defun-r 'fabdata-process-dwgs)
|
||||
|
||||
(defun-q fabdata-process-dwg (filename / inner ret)
|
||||
"Opens a fab drawing and calls the appropriate processing function to extract data"
|
||||
(defun inner (dwg / fabtype)
|
||||
(setq fabtype (get-custom-dwgprop "fab"))
|
||||
(if fabtype
|
||||
(if *dev-mode*
|
||||
(attempt-apply (read (strcat "fabdata--process-" fabtype)) (list dwg))
|
||||
(progn
|
||||
(setq ret (vl-catch-all-apply (read (strcat "fabdata--process-" fabtype))
|
||||
(list dwg)))
|
||||
(if (vl-catch-all-error-p ret)
|
||||
(progn
|
||||
(vla-Close acadDoc)
|
||||
(reset-doc)
|
||||
(error (catch-all-error ret)))
|
||||
ret)))
|
||||
(progn
|
||||
(add-to-list 'skipped-dwgs dwg)
|
||||
ret)))
|
||||
|
||||
(defun-q fabdata--process-dwg (filename / inner ret)
|
||||
"Opens a fab drawing and processes all the tables"
|
||||
(declare (vars (filename str)))
|
||||
(defun inner (dwgno / finish)
|
||||
(setq finish (get-finish))
|
||||
(foreach table (get-all-tables)
|
||||
((lambda(table / title)
|
||||
(setq title (table-get-title table))
|
||||
(cond ((= title "Material") (fabdata--process-assembly-material table))
|
||||
((= title "Misc Material") (fabdata--process-misc-material table))
|
||||
((= title "Bracket Hardware") (fabdata--process-bracket-hardware table))
|
||||
((wcmatch title "*Hardware") (fabdata--process-hardware table))
|
||||
((or (= title "Handrail Returns")
|
||||
(= title "Wall Rails")
|
||||
(wcmatch title "*Stair Rails")
|
||||
(wcmatch title "Assembly*"))
|
||||
(fabdata--process-assemblies table))
|
||||
))
|
||||
table)))
|
||||
(open-and (strcat (vla-get-Path acadDoc) "/" filename)
|
||||
T
|
||||
'inner
|
||||
(list (string-subst-all "" ".dwg" filename))))
|
||||
(defun-r 'fabdata-process-dwg)
|
||||
|
||||
(defun-q fabdata--process-generic (dwg
|
||||
/ ret mat-table hdw-table ass-table
|
||||
fin-table weight ass-text finish jobno
|
||||
sl-mat derror chkstr chkass chkmat chkhdw ret)
|
||||
"Processes a generic fab drawing"
|
||||
(defun derror (name) (setq *last-error* (strcat dwg ": missing " name)) (error *last-error*))
|
||||
(debug-print '("Extracting fabdata from " #dwg))
|
||||
(setq mat-table (get-table-by-title "Material")
|
||||
ass-table (get-table-by-title "Assembly*")
|
||||
hdw-table (get-table-by-title "Hardware")
|
||||
fin-table (get-table-by-title "Finish"))
|
||||
(defun chktbl (tbl name) (if (not (vl-symbol-value tbl)) (derror (strcat name " table"))))
|
||||
(mapcar 'chktbl
|
||||
'(mat-table ass-table hdw-table fin-table)
|
||||
'("material" "assembly" "hardware" "finish"))
|
||||
(setq jobno (xd-value "number" job-info)
|
||||
weight (vla-GetText mat-table
|
||||
(1- (vla-get-Rows mat-table))
|
||||
(1- (vla-get-Columns mat-table)))
|
||||
mat-table (parse-table mat-table)
|
||||
ass-text (substr (vla-GetText ass-table 0 0) 11)
|
||||
ass-table (parse-table ass-table)
|
||||
stairno (nth 1 (car ass-table))
|
||||
hdw-table (parse-table (get-table-by-title "Hardware"))
|
||||
finish (vla-GetText fin-table 1 0))
|
||||
(defun chkstr (str name) (if (or (null str) (= (strlen str) 0)) (derror name)))
|
||||
(mapcar 'chkstr
|
||||
(list weight ass-text stairno finish)
|
||||
'("total weight" "assembly description" "stair number" "finish"))
|
||||
(debug-print-vars '(jobno stairno mat-table hdw-table ass-table weight finish))
|
||||
;; assemblies
|
||||
(foreach assembly ass-table
|
||||
(defun chkass (idx name)
|
||||
(chkstr (nth idx assembly) (strcat name " (" (to-string assembly) ")")))
|
||||
(mapcar 'chkass
|
||||
'(0 1 2)
|
||||
'("part type"
|
||||
"stair number"
|
||||
"level"))
|
||||
(add-to-list 'ret (list jobno
|
||||
(nth 0 assembly)
|
||||
(nth 1 assembly)
|
||||
(nth 2 assembly)
|
||||
(nth 3 assembly)
|
||||
""
|
||||
""
|
||||
""
|
||||
ass-text
|
||||
""
|
||||
""
|
||||
weight
|
||||
""
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
"1")))
|
||||
;; process material table
|
||||
(foreach material mat-table
|
||||
(defun chkmat (idx name) (chkstr (nth idx material)
|
||||
(strcat name " (" (nth 0 material) ")")))
|
||||
(mapcar 'chkmat
|
||||
'(0 1 2 4 5)
|
||||
'("mark" "quantity" "description"))
|
||||
(setq desc (nth 2 material))
|
||||
;; ship loose material
|
||||
(if (wcmatch (last material) "*SL*")
|
||||
(foreach assembly ass-table
|
||||
(add-to-list 'ret (list jobno
|
||||
(nth 0 assembly)
|
||||
(nth 1 assembly)
|
||||
(nth 2 assembly)
|
||||
(nth 3 assembly)
|
||||
((lambda(subtype)
|
||||
(if subtype (nth 5 subtype) ""))
|
||||
(assoc desc (read-csv "fab/material.csv")))
|
||||
(car material)
|
||||
""
|
||||
desc
|
||||
(nth 3 material)
|
||||
(nth 4 material)
|
||||
(to-string
|
||||
(/ (?f (distof (nth 5 material)))
|
||||
(length ass-table)))
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(to-string
|
||||
(/ (atoi (nth 1 material))
|
||||
(length ass-table))))))))
|
||||
;; process hardware table
|
||||
(foreach hardware hdw-table
|
||||
(defun chkhdw (idx name) (chkstr (nth idx hardware)
|
||||
(strcat "hardware " name)))
|
||||
(mapcar 'chkhdw
|
||||
'(0 1)
|
||||
'("quantity" "description"))
|
||||
;; ship loose hardware
|
||||
(if (wcmatch (last hardware) "*SL*")
|
||||
(repeat (atoi (car hardware))
|
||||
(add-to-list 'sl-hdw (nth 1 hardware)))))
|
||||
ret)
|
||||
(defun-r 'fabdata--process-generic)
|
||||
|
||||
(defun-q fabdata--process-generic-ship-loose (dwg / finish mat-table ret)
|
||||
"Processes a generic ship loose drawing"
|
||||
(setq finish (vla-GetText (get-table-by-title "Finish") 1 0)
|
||||
mat-table (get-table-by-title "Material")
|
||||
stairno (vla-GetText mat-table 2 1))
|
||||
;; material
|
||||
((lambda(/ row mat-csv)
|
||||
(setq row 1
|
||||
mat-csv (read-csv "fab/material.csv"))
|
||||
(repeat (- (vla-get-Rows mat-table) 2)
|
||||
(inc! 'row)
|
||||
((lambda(row / v)
|
||||
(defun v (k) (xd-value k row))
|
||||
(if (wcmatch (v 'note) "*SL*")
|
||||
(add-to-list 'ret
|
||||
(list jobno
|
||||
(v 'type)
|
||||
(v 'num)
|
||||
(v 'lvl)
|
||||
(v 'seq)
|
||||
(nth 5 (assoc (v 'desc) mat-csv))
|
||||
(v 'det)
|
||||
""
|
||||
(v 'desc)
|
||||
(v 'wid)
|
||||
(v 'len)
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(v 'qty))))
|
||||
(if (/= (v 'desc) "")
|
||||
(repeat (atoi (v 'qty))
|
||||
(add-to-list 'materials (mapcar 'v '(lvl desc wid len))))))
|
||||
(mapcar '(lambda(k n) (list k (vla-GetText mat-table row n)))
|
||||
'(type num lvl seq det qty desc wid len note)
|
||||
(range 0 10 1))))))
|
||||
;; hardware
|
||||
(foreach hardware (parse-table (get-table-by-title "Hardware"))
|
||||
(if (wcmatch (last hardware) "*SL*")
|
||||
(repeat (atoi (car hardware))
|
||||
(add-to-list 'sl-hdw (nth 1 hardware)))))
|
||||
ret)
|
||||
(defun-r 'fabdata--process-generic-ship-loose)
|
||||
|
||||
(defun-q fabdata--process-spreadsheet (table-name first-row / table ret)
|
||||
"Generic processor for spreadsheet style drawings
|
||||
|
||||
TABLE-NAME is the name of the main table and FIRST-ROW is the (0-based) index of the first
|
||||
row after the header rows (i.e. the first row containing data)."
|
||||
(setq table (parse-table (get-table-by-title table-name)))
|
||||
(repeat (- first-row 2)
|
||||
(pop! 'table))
|
||||
(setq stairno (nth 1 (car table)))
|
||||
(foreach row table
|
||||
(add-to-list 'ret
|
||||
(list jobno
|
||||
(nth 0 row)
|
||||
(nth 1 row)
|
||||
(nth 2 row)
|
||||
(nth 3 row)
|
||||
""
|
||||
""
|
||||
""
|
||||
(get-custom-dwgprop "description")
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
(vla-GetText (get-table-by-title "Finish") 1 0)
|
||||
dwg
|
||||
""
|
||||
"1")))
|
||||
ret)
|
||||
(defun-r 'fabdata--process-spreadsheet)
|
||||
|
||||
(defun-q fabdata--process-stair-rail (dwg)
|
||||
"Processes a stair rail drawing"
|
||||
(fabdata--process-spreadsheet "*Stair Rail*" 3))
|
||||
(defun-r 'fabdata--process-stair-rail)
|
||||
|
||||
(defun-q fabdata--process-wall-rail (dwg)
|
||||
"Processes a wall rail drawing"
|
||||
(setq hdw (cdr (parse-table (get-table-by-title "Bracket Hardware")))
|
||||
hdw (cdr (reverse hdw)))
|
||||
(foreach h hdw
|
||||
(repeat (atoi (car h)) (add-to-list 'sl-hdw "DRIVE NAIL 1/4 x 2"))
|
||||
(repeat (atoi (cadr h)) (add-to-list 'sl-hdw "TEK SCREW #12 x 3")))
|
||||
(fabdata--process-spreadsheet "*Wall Rail*" 3))
|
||||
(defun-r 'fabdata--process-wall-rail)
|
||||
|
||||
(defun-q fabdata--process-return (dwg)
|
||||
"Processes a handrail return drawing"
|
||||
(fabdata--process-spreadsheet "*Handrail Return*" 2))
|
||||
(defun-r 'fabdata--process-return)
|
||||
|
||||
(defun-q fabdata--process-land-post (dwg / tbl finish base ret)
|
||||
"Processes a ship loose landing posts drawing"
|
||||
(setq tbl (cdr (parse-table (get-table-by-title "Landing Posts")))
|
||||
stairno (nth 1 (car tbl))
|
||||
finish (vla-GetText (get-table-by-title "Finish") 1 0))
|
||||
|
||||
(foreach row tbl
|
||||
(setq base (list jobno
|
||||
(nth 0 row)
|
||||
(nth 1 row)
|
||||
(nth 2 row)
|
||||
(nth 3 row)))
|
||||
;; post
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "HS"
|
||||
""
|
||||
""
|
||||
(nth 6 row)
|
||||
""
|
||||
(nth 7 row)
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 9 row))))
|
||||
;; expansion anchors
|
||||
(if (/= (nth 15 row) "")
|
||||
(repeat (read (nth 15 row))
|
||||
(add-to-list 'sl-hdw
|
||||
"HILTI KB-TZ WEDGE ANCHOR 5/8 DIA. x 4 3/4")))
|
||||
;; 2" hex bolt
|
||||
(if (/= (nth 16 row) "")
|
||||
(repeat (read (nth 16 row))
|
||||
(add-to-list 'sl-hdw "HEX BOLT (A307) 5/8 DIA. x 2")))
|
||||
;; 4" hex bolt
|
||||
(if (/= (nth 17 row) "")
|
||||
(repeat (read (nth 17 row))
|
||||
(add-to-list 'sl-hdw "HEX BOLT (A307) 5/8 DIA. x 4")))
|
||||
;; 4 1/2" hex bolt
|
||||
(if (/= (nth 18 row) "")
|
||||
(repeat (read (nth 18 row))
|
||||
(add-to-list 'sl-hdw "HEX BOLT (A307) 5/8 DIA. x 4 1/2")))
|
||||
;; hex nut
|
||||
(if (/= (nth 19 row) "")
|
||||
(repeat (read (nth 19 row))
|
||||
(add-to-list 'sl-hdw "HEX NUT 5/8 DIA.")))
|
||||
;; flat washer
|
||||
(if (/= (nth 20 row) "")
|
||||
(repeat (read (nth 20 row))
|
||||
(add-to-list 'sl-hdw "FLAT WASHER 5/8 DIA.")))
|
||||
;; lock washer
|
||||
(if (/= (nth 21 row) "")
|
||||
(repeat (read (nth 21 row))
|
||||
(add-to-list 'sl-hdw "LOCK WASHER 5/8 DIA.")))
|
||||
;; bevel washer
|
||||
(if (/= (nth 22 row) "")
|
||||
(repeat (read (nth 22 row))
|
||||
(add-to-list 'sl-hdw "BEVEL WASHER 5/8 DIA."))))
|
||||
ret)
|
||||
(defun-r 'fabdata--process-land-post)
|
||||
|
||||
(defun-q fabdata--process-land-hanger (dwg / tbl finish base ret)
|
||||
"Processes a ship loose landing hangers drawing"
|
||||
(setq tbl (cdr (parse-table (get-table-by-title "Hangers and Kick Braces")))
|
||||
stairno (nth 1 (car tbl))
|
||||
finish (vla-GetText (get-table-by-title "Finish") 1 0))
|
||||
(foreach row tbl
|
||||
(setq base (list jobno
|
||||
(nth 0 row)
|
||||
(nth 1 row)
|
||||
(nth 2 row)
|
||||
(nth 3 row)))
|
||||
;; hanger rod
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "AT"
|
||||
""
|
||||
""
|
||||
(strcat "ALL THREAD " (nth 4 row) " DIA.")
|
||||
""
|
||||
(nth 6 row)
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 5 row))))
|
||||
;; P1 / P4
|
||||
((lambda(/ qty)
|
||||
(if (or (/= (setq qty (nth 10 row)) "")
|
||||
(/= (setq qty (nth 13 row)) ""))
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "PL"
|
||||
""
|
||||
""
|
||||
(strcat "PLATE " (nth 7 row))
|
||||
(nth 8 row)
|
||||
(nth 9 row)
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
qty))))))
|
||||
;; P2
|
||||
(if (/= (nth 11 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "PL"
|
||||
""
|
||||
""
|
||||
"PLATE 3/8"
|
||||
"8"
|
||||
"8"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 11 row)))))
|
||||
;; P3
|
||||
(if (/= (nth 12 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "PL"
|
||||
""
|
||||
""
|
||||
"PLATE 1/4"
|
||||
"4"
|
||||
"4"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 12 row)))))
|
||||
;; A2
|
||||
(if (/= (nth 15 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "AN"
|
||||
""
|
||||
""
|
||||
"ANGLE 3 x 3 x 1/4"
|
||||
""
|
||||
(nth 15 row)
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 17 row)))))
|
||||
;; A3
|
||||
(if (/= (nth 18 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "AN"
|
||||
""
|
||||
""
|
||||
"ANGLE 4 x 4 x 3/8"
|
||||
""
|
||||
"18"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 18 row)))))
|
||||
;; A4
|
||||
(if (/= (nth 19 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "AN"
|
||||
""
|
||||
""
|
||||
"ANGLE 4 x 4 x 3/8"
|
||||
""
|
||||
"18"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 19 row)))))
|
||||
;; 3/4 hex nut
|
||||
(if (/= (nth 20 row) "")
|
||||
(repeat (read (nth 20 row))
|
||||
(add-to-list 'sl-hdw "HEX NUT 3/4 DIA.")))
|
||||
;; 3/4 flat washer
|
||||
(if (/= (nth 21 row) "")
|
||||
(repeat (read (nth 21 row))
|
||||
(add-to-list 'sl-hdw "FLAT WASHER 3/4 DIA.")))
|
||||
;; 3/4 coupler nut
|
||||
(if (/= (nth 22 row) "")
|
||||
(repeat (read (nth 22 row))
|
||||
(add-to-list 'sl-hdw "COUPLER NUT 3/4 DIA.")))
|
||||
;; 1 hex nut
|
||||
(if (/= (nth 23 row) "")
|
||||
(repeat (read (nth 23 row))
|
||||
(add-to-list 'sl-hdw "HEX NUT 1 DIA.")))
|
||||
;; 1 flat washer
|
||||
(if (/= (nth 24 row) "")
|
||||
(repeat (read (nth 24 row))
|
||||
(add-to-list 'sl-hdw "FLAT WASHER 1 DIA.")))
|
||||
;; 1 coupler nut
|
||||
(if (/= (nth 25 row) "")
|
||||
(repeat (read (nth 25 row))
|
||||
(add-to-list 'sl-hdw "COUPLER NUT 1 DIA.")))
|
||||
;; expansion anchor
|
||||
(if (/= (nth 26 row) "")
|
||||
(repeat (read (nth 26 row))
|
||||
(add-to-list 'sl-hdw "HILTI KB-TZ WEDGE ANCHOR 5/8 DIA. x 4 3/4"))))
|
||||
ret)
|
||||
(defun-r 'fabdata--process-land-hanger)
|
||||
|
||||
(defun-q fabdata--process-land-ledger (dwg / tbl finish base ret)
|
||||
"Processes a ship loose landing ledger drawing"
|
||||
(setq tbl (cdr (parse-table (get-table-by-title "Ledger Angles")))
|
||||
stairno (nth 1 (car tbl))
|
||||
finish (vla-GetText (get-table-by-title "Finish") 1 0))
|
||||
(foreach row tbl
|
||||
(setq base (list jobno
|
||||
(nth 0 row)
|
||||
(nth 1 row)
|
||||
(nth 2 row)
|
||||
(nth 3 row)))
|
||||
;; ledger angle
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "AN"
|
||||
""
|
||||
""
|
||||
(strcat "ANGLE "
|
||||
(strjoin (strsplit (substr (nth 5 row) 2) "x") " x "))
|
||||
""
|
||||
"8"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 6 row))))
|
||||
;; P2
|
||||
(if (/= (nth 11 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "PL"
|
||||
""
|
||||
""
|
||||
"PLATE 3/8"
|
||||
"12"
|
||||
"12"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 11 row)))))
|
||||
;; R1
|
||||
(if (/= (nth 12 row) "")
|
||||
(add-to-list 'ret
|
||||
(append
|
||||
base
|
||||
(list "BR"
|
||||
""
|
||||
""
|
||||
"BENT ROD 5/8 DIA."
|
||||
"4"
|
||||
"5 1/2"
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 12 row)))))
|
||||
;; expansion anchors
|
||||
(if (/= (nth 13 row) "")
|
||||
(repeat (read (nth 13 row))
|
||||
(add-to-list 'sl-hdw "HILTI KB-TZ WEDGE ANCHOR 5/8 DIA. x 4 3/4")))
|
||||
;; screw anchors
|
||||
(if (/= (nth 14 row) "")
|
||||
(repeat (read (nth 14 row))
|
||||
(add-to-list 'sl-hdw "HILTI KH-EZ SCREW ANCHOR 5/8 DIA. x 5 1/2"))))
|
||||
ret)
|
||||
(defun-r 'fabdata--process-land-ledger)
|
||||
|
||||
;; process closure plate fab
|
||||
(defun-q fabdata--process-closure-plate (dwg / tbl finish ret)
|
||||
"Processes a closure plate drawing"
|
||||
(setq tbl (cdr (parse-table (get-table-by-title "Closure Plates")))
|
||||
stairno (nth 1 (car tbl))
|
||||
finish (vla-GetText (get-table-by-title "Finish") 1 0))
|
||||
(mapcar '(lambda(row / len)
|
||||
(setq len (if (= (nth 4 row) "1") 6 12))
|
||||
(list jobno
|
||||
(nth 0 row)
|
||||
(nth 1 row)
|
||||
(nth 2 row)
|
||||
(nth 3 row)
|
||||
""
|
||||
""
|
||||
""
|
||||
"CLOSURE PLATE"
|
||||
(nth 5 row)
|
||||
(to-string len)
|
||||
(rtos (* (/ (* (distof (nth 5 row)) len) 144.0) 10.21) 2 1)
|
||||
""
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
"1"))
|
||||
tbl))
|
||||
(defun-r 'fabdata--process-closure-plate)
|
||||
|
||||
(defun-q fabdata--process-land-xbrace (dwg / tbl finish ret)
|
||||
"Processes a cross-bracing drawing"
|
||||
(setq tbl (cdr (parse-table (get-table-by-title "Cross Bracing")))
|
||||
stairno (nth 1 (car tbl))
|
||||
finish (vla-GetText (get-table-by-title "Finish") 1 0))
|
||||
(mapcar '(lambda(row / len)
|
||||
(setq len (if (= (nth 4 row) "1") 6 12))
|
||||
(list jobno
|
||||
(nth 0 row)
|
||||
(nth 1 row)
|
||||
(nth 2 row)
|
||||
(nth 3 row)
|
||||
""
|
||||
""
|
||||
""
|
||||
(if (= (nth 4 row) "1")
|
||||
"HSS 2 1/2 x 1 1/2 x 1/4"
|
||||
"HSS 3 x 3 x 1/4")
|
||||
""
|
||||
(nth 6 row)
|
||||
""
|
||||
"SL"
|
||||
finish
|
||||
dwg
|
||||
""
|
||||
(nth 5 row)))
|
||||
tbl))
|
||||
(defun-r 'fabdata--process-land-xbrace)
|
||||
(defun-r 'fabdata--process-dwg)
|
||||
|
||||
(defun-q fabdata--mat-table-total-weight (table / n title)
|
||||
"Returns the total weight
|
||||
|
||||
Calculates the total based on row weight values; does not rely on summary row."
|
||||
(declare (vars (table vla-object (material-table-p table))))
|
||||
(setq parsed-table (parse-table table)
|
||||
n (length parsed-table))
|
||||
(if (> 0)
|
||||
(rtos (/ (apply '+
|
||||
(mapcar '(lambda(row / weight)
|
||||
(setq weight (xd-value "weight" row))
|
||||
(if weight
|
||||
(?f (read weight))
|
||||
0.0))
|
||||
parsed-table))
|
||||
n)
|
||||
2 2)
|
||||
""))
|
||||
(defun-r 'fabdata--mat-table-total-weight)
|
||||
|
||||
(defun-q fabdata--process-assemblies (table / parsed-table weight cols desc)
|
||||
"Processes an Assembly* table for assemblies
|
||||
|
||||
Attempts to set the piece weight using the Material table."
|
||||
(declare (vars (table vla-object (table-p table))))
|
||||
((lambda(/ mat-table)
|
||||
(setq mat-table (get-table-by-title "Material")
|
||||
weight (if mat-table (fabdata--mat-table-total-weight mat-table) ""))))
|
||||
(if (wcmatch title "Assembly:*")
|
||||
(setq desc (vl-string-left-trim " " (substr title 10))
|
||||
cols '("pm" "stair" "lvl" "seq"))
|
||||
(setq desc (get-custom-dwgprop "description")
|
||||
cols '("mark" "stair_number" "level" "sequence")))
|
||||
(foreach assembly (parse-table table)
|
||||
(setq stairno (xd-value (nth 1 cols) assembly))
|
||||
(add-to-list 'assemblies
|
||||
(list
|
||||
jobno
|
||||
(xd-value (nth 0 cols) assembly)
|
||||
(xd-value (nth 1 cols) assembly)
|
||||
(xd-value (nth 2 cols) assembly)
|
||||
(xd-value (nth 3 cols) assembly)
|
||||
"" "" ""
|
||||
desc
|
||||
"" ""
|
||||
weight
|
||||
""
|
||||
finish
|
||||
dwgno
|
||||
""
|
||||
"1"))))
|
||||
(defun-r 'fabdata--process-assemblies)
|
||||
|
||||
(defun-q fabdata--get-material-code (desc / mat)
|
||||
"Returns the short code for a material description, if it exists, or an empty string"
|
||||
(declare (vars (desc str)))
|
||||
(setq mat (assoc desc matlst))
|
||||
(if mat (nth 5 mat) ""))
|
||||
(defun-r 'fabdata--get-material-code)
|
||||
|
||||
(defun-q fabdata--process-assembly-material (table / assemblies n)
|
||||
"Processes a Material table (paired with an Assembly* table) for ship loose items"
|
||||
(declare (vars (table vla-object (table-p table))))
|
||||
(setq assemblies (get-table-by-title "Assembly*"))
|
||||
(if (not assemblies) (error "No Assembly* table found while processing Material table"))
|
||||
(setq assemblies (parse-table assemblies)
|
||||
n (length assemblies))
|
||||
(foreach mat (parse-table table)
|
||||
(if (wcmatch (xd-value "note" mat) "*SL*")
|
||||
(foreach assembly assemblies
|
||||
(add-to-list 'material
|
||||
(append
|
||||
(with-data assembly
|
||||
'((list jobno pm stair lvl seq)))
|
||||
(with-data mat
|
||||
'((list
|
||||
(fabdata--get-material-code desc)
|
||||
mark
|
||||
""
|
||||
desc
|
||||
width
|
||||
length
|
||||
weight
|
||||
note
|
||||
finish
|
||||
dwgno
|
||||
""
|
||||
(/ (atoi qty) n))))))))))
|
||||
(defun-r 'fabdata--process-assembly-material)
|
||||
|
||||
(defun-q fabdata--process-misc-material (table)
|
||||
"Processes a Misc Material table for ship loose items"
|
||||
(declare (vars (table vla-object (table-p table))))
|
||||
(foreach mat (parse-table table)
|
||||
(if (wcmatch (xd-value "note" mat) "*SL*")
|
||||
(add-to-list 'material
|
||||
(with-data mat
|
||||
'((setq stairno stair_number)
|
||||
(list
|
||||
jobno piece_type stair_number level sequence
|
||||
(fabdata--get-material-code desc)
|
||||
mark
|
||||
""
|
||||
desc width length weight note
|
||||
finish dwgno
|
||||
""
|
||||
qty)))))))
|
||||
(defun-r 'fabdata--process-misc-material)
|
||||
|
||||
(defun-q fabdata--get-hardware-code (desc / hdw)
|
||||
"Returns the short code for a hardware description, if it exists, or an empty string"
|
||||
(declare (vars (desc str)))
|
||||
(setq hdw (assoc desc hdwlst))
|
||||
(if hdw (nth 1 hdw) ""))
|
||||
(defun-r 'fabdata--get-hardware-code)
|
||||
|
||||
(defun-q fabdata--format-hardware (hdw)
|
||||
"Adds hardware code and makes qty an integer"
|
||||
(declare (vars (hdw list (data-list-p hdw))))
|
||||
(cons (list "hdw_code" (fabdata--get-hardware-code (xd-value "desc" hdw)))
|
||||
(subst-key "qty" (atoi (xd-value "qty" hdw)) hdw)))
|
||||
(defun-r 'fabdata--format-hardware)
|
||||
|
||||
(defun-q fabdata--process-hardware (table)
|
||||
"Processes a *Hardware table for ship loose entries"
|
||||
(declare (vars (table vla-object (table-p table))))
|
||||
(foreach hdw (parse-table table)
|
||||
(if (wcmatch (xd-value "note" hdw) "*SL*")
|
||||
(add-to-list 'hardware (fabdata--format-hardware hdw)))))
|
||||
(defun-r 'fabdata--process-hardware)
|
||||
|
||||
(defun-q fabdata--process-bracket-hardware (table / parsed-table)
|
||||
"Processes a legacy Bracket Hardware table
|
||||
|
||||
This can be removed after people finish the jobs they started during this rewrite and this table style disappears"
|
||||
(setq parsed-table (parse-table table))
|
||||
(mapcar '(lambda(row / dn ts)
|
||||
(setq dn (xd-value "#_drive_nails" row)
|
||||
dn (if dn dn (xd-value "1/4_x_2_drive_nails" row))
|
||||
ts (xd-value "#_tek_screws" row)
|
||||
ts (if ts ts (xd-value "#12_tek_screws" row)))
|
||||
(if (> (safe-atoi dn) 0)
|
||||
(add-to-list 'hardware
|
||||
(fabdata--format-hardware (#! '(("qty" #dn)
|
||||
("desc" "DRIVE NAIL 1/4 x 2")
|
||||
("note" "SL"))))))
|
||||
(if (> (safe-atoi ts) 0)
|
||||
(add-to-list 'hardware
|
||||
(fabdata--format-hardware (#! '(("qty" #ts)
|
||||
("desc" "TEK SCREW #12 x 3")
|
||||
("note" "SL")))))))
|
||||
(take (1- (length parsed-table)) parsed-table)))
|
||||
(defun-r 'fabdata--process-bracket-hardware)
|
||||
|
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.
@ -1,163 +1,108 @@
|
||||
(psc-include '("fab/land-ship-loose.lsp"))
|
||||
(set-file-docstring "Functions for calculating landing hanger fabs")
|
||||
|
||||
(defun calc-land-sl-hangers (/ calc combine ret)
|
||||
(expect-with-data "calc-land-sl-posts")
|
||||
(defun-q land-hanger-p (corner)
|
||||
"Returns T if there is a hanger at this corner"
|
||||
(declare (vars (corner str (member corner '("fl" "fr" "bl" "br"))))
|
||||
with-data)
|
||||
(member (cornerkey "chan_num") '("40" "50")))
|
||||
(defun-r 'land-hanger-p)
|
||||
|
||||
(defun calc (corner / chan supp base len qty kick-p)
|
||||
(setq chan (cornerkey "chan_num")
|
||||
supp (cornerkey "supp_num")
|
||||
base (#! '(("chan" #chan)
|
||||
("supp" #supp)
|
||||
("mark" "P")
|
||||
("num" #number)
|
||||
("level" #level)
|
||||
("seq" #sequence)))
|
||||
len (ceil (+ (cornerkey "len")
|
||||
flr_thick
|
||||
(if (begins-with corner "f") front_chan_dpt back_chan_dpt)
|
||||
6))
|
||||
qty (ceil (/ len 144.0))
|
||||
len (ceil (/ len qty))
|
||||
kick-p (member (substr supp 2 1) '("7" "8" "9")))
|
||||
(append
|
||||
base
|
||||
(#! '(("diameter" #(if (= chan "40") "3/4" "1"))
|
||||
("qty" #qty)
|
||||
("length" #len)))
|
||||
(if (member (substr supp 2 1) '("3" "8" "9"))
|
||||
(#! '(("p1-thick" #(frac (cornerkey "plt_thick")))
|
||||
("p1-wid" #(frac (cornerkey "plt_wid")))
|
||||
("p1-len" #(frac (- (cornerkey "plt_hgt") 0.125)))
|
||||
("p1-qty" #(if (ends-with supp "9") 0 1))))
|
||||
'(("p1-thick" "")
|
||||
("p1-wid" "")
|
||||
("p1-len" "")
|
||||
("p1-qty" 0)))
|
||||
(#! '(("p2-qty" #(if (member (substr supp 2 1) '("1" "2" "4" "5" "7")) 1 0))
|
||||
("p3-qty" #(if kick-p
|
||||
(+ 1 (if (or (begins-with (cornerkey "kick_style") "06")
|
||||
(= (cornerkey "kick_deck") "Parallel"))
|
||||
1 0))
|
||||
0))
|
||||
("p4-qty" #(if (ends-with supp "9") 1 0))
|
||||
("a1-len" #(if (ends-with supp "9") (frac (- (cornerkey "plt_wid") 3.75)) ""))
|
||||
("a2-len" #(if kick-p
|
||||
(frac (cornerkey "kick_len"))
|
||||
""))
|
||||
("a1-qty" #(if (ends-with supp "9") 4 0))
|
||||
("a2-qty" #(if kick-p 1 0))
|
||||
("a3-qty" #(if (and kick-p (begins-with (cornerkey "kick_style") "08")) 1 0))
|
||||
("a4-qty" #(if (and kick-p (begins-with (cornerkey "kick_style") "07")) 1 0))
|
||||
("34nut-qty" #(if (begins-with chan "4") 3 0))
|
||||
("34wash-qty" #(if (begins-with chan "4") 2 0))
|
||||
("34coup-qty" #(if (begins-with chan "4") (1- qty) 0))
|
||||
("1nut-qty" #(if (begins-with chan "5") 3 0))
|
||||
("1wash-qty" #(if (begins-with chan "5") 2 0))
|
||||
("1coup-qty" #(if (begins-with chan "5") (1- qty) 0))
|
||||
("exp-qty" #(if (and kick-p (begins-with (cornerkey "kick_style") "07")) 2 0))))))
|
||||
(defun-q land-hanger-calc (corner / chan supp len qty dia kick-p)
|
||||
"Calculates the hanger material and hardware for this CORNER of the current landing
|
||||
|
||||
(defun combine (hangers / combo-slice ret found-match-p)
|
||||
(defun combo-slice (lst)
|
||||
(append (slice lst 0 7)
|
||||
(slice lst 8 4)
|
||||
(slice lst 16 2)))
|
||||
(setq ret (list (pop! 'hangers)))
|
||||
(while hangers
|
||||
(foreach idx (range 0 (length ret) 1)
|
||||
(if (not found-match-p)
|
||||
(if (vl-every 'equal (combo-slice (nth idx ret)) (combo-slice (car hangers)))
|
||||
(setq found-match-p T
|
||||
ret
|
||||
(append
|
||||
(slice ret 0 idx)
|
||||
((lambda(/ l1 l2)
|
||||
(setq l1 (nth idx ret)
|
||||
l2 (pop! 'hangers))
|
||||
(foreach key '("qty"
|
||||
"p1-qty"
|
||||
"p2-qty"
|
||||
"p3-qty"
|
||||
"p4-qty"
|
||||
"a1-qty"
|
||||
"a2-qty"
|
||||
"a3-qty"
|
||||
"a4-qty"
|
||||
"34nut-qty"
|
||||
"34wash-qty"
|
||||
"34coup-qty"
|
||||
"1nut-qty"
|
||||
"1wash-qty"
|
||||
"1coup-qty"
|
||||
"exp-qty")
|
||||
(subst-key! key (+ (xd-value key l1) (xd-value key l2)) 'l1))
|
||||
(list l1)))
|
||||
(slice ret (1+ idx) (length ret)))))))
|
||||
(if (not found-match-p)
|
||||
(add-to-list 'ret (pop! 'hangers)))
|
||||
(setq found-match-p nil))
|
||||
ret)
|
||||
(foreach corner '("fl" "fr" "bl" "br")
|
||||
(if (member (cornerkey "chan_num") '("40" "50"))
|
||||
(add-to-list 'ret (calc corner))))
|
||||
(if ret
|
||||
(cons finish
|
||||
(mapcar '(lambda(lst) (mapcar (compose '(to-string cadr)) lst))
|
||||
(mapcar 'cddr (combine ret))))))
|
||||
|
||||
(defun make-land-sl-hanger-fabs (hanger-map)
|
||||
(foreach hangers hanger-map
|
||||
((lambda(/ finish)
|
||||
(setq finish (pop! 'hangers))
|
||||
(while hangers
|
||||
(make-land-sl-hanger-fab finish (take! 46 'hangers)))))))
|
||||
|
||||
(defun make-land-sl-hanger-fab (finish hangers / dwgno path login qtys)
|
||||
(setq dwgno (land-fab-calc-sl-dwg-no jobno stairno))
|
||||
(debug-print '("Making hanger fab dwg: " #dwgno))
|
||||
(setq path (vla-get-Path acadDoc)
|
||||
login (getvar 'loginname)
|
||||
acadDoc (vla-Add (vla-get-Documents acadObj)
|
||||
(strcat psc-src-dir "fab/land-hanger.dwt"))
|
||||
modelspace (vla-get-ModelSpace acadDoc))
|
||||
|
||||
(write-title-block job-info stairno login "SHIP LOOSE HANGERS")
|
||||
;; write finish table
|
||||
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
|
||||
;; write main table
|
||||
(land-fab-write-sl-main-table "Hangers and Kick Braces"
|
||||
hangers
|
||||
'(11 12 18 19 20 21 22 23 24 25 26))
|
||||
|
||||
;; write quantity summary table
|
||||
(foreach hanger hangers
|
||||
(repeat (read (nth 5 hanger))
|
||||
(add-to-list 'qtys (strcat "Threaded Rod "
|
||||
(nth 4 hanger)
|
||||
" x "
|
||||
(nth 6 hanger))))
|
||||
(repeat (read (nth 10 hanger))
|
||||
(add-to-list 'qtys (strcat "P1 ("
|
||||
(nth 7 hanger)
|
||||
" x "
|
||||
(nth 8 hanger)
|
||||
" x "
|
||||
(nth 9 hanger)
|
||||
")")))
|
||||
(repeat (read (nth 13 hanger))
|
||||
(add-to-list 'qtys (strcat "P4 ("
|
||||
(nth 7 hanger)
|
||||
" x "
|
||||
(nth 8 hanger)
|
||||
" x "
|
||||
(nth 9 hanger)
|
||||
")")))
|
||||
(repeat (read (nth 16 hanger))
|
||||
(add-to-list 'qtys (strcat "A1 (" (nth 14 hanger) ")")))
|
||||
(repeat (read (nth 17 hanger))
|
||||
(add-to-list 'qtys (strcat "A2 (" (nth 15 hanger) ")"))))
|
||||
(land-fab-write-sl-qty-table (count-items (vl-sort qtys 'sort-strings-asc)))
|
||||
|
||||
(vla-Regen acadDoc acAllViewports)
|
||||
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
|
||||
(if (not *dev-mode*) (vla-Close acadDoc))
|
||||
(reset-doc))
|
||||
Assumed to be called by %land-sl--calc"
|
||||
(declare (vars (corner str (member corner '("fl" "fr" "bl" "br"))))
|
||||
with-data)
|
||||
(setq chan (cornerkey "chan_num")
|
||||
supp (cornerkey "supp_num")
|
||||
len (ceil (+ (cornerkey "len")
|
||||
flr_thick
|
||||
(if (begins-with corner "f") front_chan_dpt back_chan_dpt)
|
||||
6))
|
||||
qty (ceil (/ len 144.0))
|
||||
len (ceil (/ len qty))
|
||||
dia (strcat (if (= chan "40") "3/4" "1") " DIA.")
|
||||
kick-p (member (substr supp 2 1) '("7" "8" "9")))
|
||||
;; hanger rod and hardware
|
||||
(add-material
|
||||
'(("qty" #qty)
|
||||
("desc" #(strcat "ALL THREAD " dia))
|
||||
("length" #len)
|
||||
("note" "SL")))
|
||||
(mapcar 'add-hardware
|
||||
'((("qty" 3)
|
||||
("desc" #(strcat "HEX NUT " dia))
|
||||
("note" "SL"))
|
||||
(("qty" 2)
|
||||
("desc" #(strcat "FLAT WASHER " dia))
|
||||
("note" "SL"))))
|
||||
(if (> qty 1)
|
||||
(add-hardware
|
||||
'(("qty" #(1- qty))
|
||||
("desc" #(strcat "COUPLER NUT " dia))
|
||||
("note" "SL"))))
|
||||
;; flag plate
|
||||
(if (member (substr supp 2 1) '("3" "8"))
|
||||
(add-material
|
||||
'(("detail" "P1")
|
||||
("qty" 1)
|
||||
("desc" #(strcat "PLATE " (frac (cornerkey "plt_thick"))))
|
||||
("width" #(frac (cornerkey "plt_wid")))
|
||||
("length" #(frac (- (cornerkey "plt_hgt") 0.125)))
|
||||
("note" "SL"))))
|
||||
;; 8x8 plate
|
||||
(if (member (substr supp 2 1) '("1" "2" "4" "5" "7"))
|
||||
(add-material
|
||||
'(("qty" 1)
|
||||
("desc" "PLATE 3/8")
|
||||
("width" "8")
|
||||
("length" "8")
|
||||
("note" "SL"))))
|
||||
(if kick-p
|
||||
(progn
|
||||
;; corner-clipped gusset
|
||||
(mapcar 'add-material
|
||||
'((("detail" "P2")
|
||||
("qty" #(+ 1 (if (or (begins-with (cornerkey "kick_style") "06")
|
||||
(= (cornerkey "kick_deck") "Parallel"))
|
||||
1 0)))
|
||||
("desc" "PLATE 1/4")
|
||||
("width" "4")
|
||||
("length" "4")
|
||||
("note" "SL"))
|
||||
(("qty" 1)
|
||||
("desc" "ANGLE 3 x 3 x 1/4")
|
||||
("length" #(frac (cornerkey "kick_len"))))))
|
||||
;; built-up flag plate
|
||||
(if (ends-with supp "9")
|
||||
(mapcar 'add-material
|
||||
'((("detail" "P3")
|
||||
("qty" 1)
|
||||
("desc" #(strcat "PLATE " (frac (cornerkey "plt_thick"))))
|
||||
("width" #(frac (cornerkey "plt_wid")))
|
||||
("length" #(frac (- (cornerkey "plt_hgt") 0.125)))
|
||||
("note" "SL"))
|
||||
(("detail" "P3a")
|
||||
("qty" 4)
|
||||
("desc" "ANGLE 3 x 3 x 1/4")
|
||||
("length" #(frac (- (cornerkey "plt_wid") 3.75)))))))
|
||||
;; slab angle
|
||||
(cond ((begins-with (cornerkey "kick_style") "07")
|
||||
(add-material
|
||||
'(("detail" "A1")
|
||||
("qty" 1)
|
||||
("desc" "ANGLE 4 x 4 x 3/8")
|
||||
("length" "18")
|
||||
("note" "SL")))
|
||||
(add-hardware
|
||||
'(("qty" 2)
|
||||
("desc" "HILTI KB-TZ2 WEDGE ANCHOR 5/8 DIA. x 4 3/4")
|
||||
("note" "SL"))))
|
||||
((begins-with (cornerkey "kick_style") "08")
|
||||
(add-material
|
||||
'(("qty" 1)
|
||||
("desc" "ANGLE 4 x 4 x 3/8")
|
||||
("length" "18")
|
||||
("note" "SL")))))))
|
||||
(list material hardware))
|
||||
(defun-r 'land-hanger-calc)
|
||||
|
Binary file not shown.
@ -1,132 +1,87 @@
|
||||
;; return a list whose car is the landing finish and cdr is the list of ledgers
|
||||
(defun calc-land-sl-ledgers (/ calc combine ret)
|
||||
(expect-with-data "calc-land-sl-ledgers")
|
||||
(set-file-docstring "Functions for making landing ledger fabs")
|
||||
|
||||
(defun calc (corner / gusset chan base)
|
||||
(defun gusset (ang)
|
||||
(setq ang (strsplit (substr ang 2) "x"))
|
||||
(list (frac (- (read (car ang)) 0.5)) (frac (- (read (cadr ang)) 0.5))))
|
||||
(setq chan (cornerkey "chan_num")
|
||||
base (#! '(("detail" #chan)
|
||||
("mark" "P")
|
||||
("num" #number)
|
||||
("level" #level)
|
||||
("seq" #sequence))))
|
||||
(cond ((member chan '("60" "61" "62" "70" "71" "72"))
|
||||
((lambda(/ ang)
|
||||
(setq ang (cornerkey "angle"))
|
||||
(append
|
||||
base
|
||||
(#! '(("detail" "1")
|
||||
("size" #ang)
|
||||
("qty" 1)
|
||||
("a1-qty" 1)
|
||||
("p1-len" #(car (gusset ang)))
|
||||
("p1-wid" #(cadr (gusset ang)))
|
||||
("p1-qty" 2)
|
||||
("p2-qty" #(if (ends-with chan "0") 0 1))
|
||||
("r1-qty" 0)
|
||||
("exp-qty" #(if (ends-with chan "1") 4 0))
|
||||
("screw-qty" #(if (ends-with chan "2") 4 0))))))))
|
||||
((member chan '("66" "67" "68" "77" "78" "79"))
|
||||
((lambda(/ ang)
|
||||
(setq ang (cornerkey "angle"))
|
||||
(append
|
||||
base
|
||||
(#! '(("detail" "2")
|
||||
("size" #ang)
|
||||
("qty" 1)
|
||||
("a1-qty" 0)
|
||||
("p1-len" #(car (gusset ang)))
|
||||
("p1-wid" #(cadr (gusset ang)))
|
||||
("p1-qty" 2)
|
||||
("p2-qty" #(if (member chan '("66" "77")) 0 1))
|
||||
("r1-qty" #(if (begins-with chan "6") 1 0))
|
||||
("exp-qty" #(if (member chan '("67" "78")) 4 0))
|
||||
("screw-qty" #(if (member chan '("68" "79")) 4 0))))))))
|
||||
((= chan "76")
|
||||
(append
|
||||
base
|
||||
(#! '(("detail" "3")
|
||||
("size" #(cornerkey "angle"))
|
||||
("qty" 1)
|
||||
("a1-qty" 1)
|
||||
("p1-len" "")
|
||||
("p1-wid" "")
|
||||
("p1-qty" 0)
|
||||
("p2-qty" 0)
|
||||
("r1-qty" 0)
|
||||
("exp-qty" 0)
|
||||
("screw-qty" 0)))))))
|
||||
(defun-q land-ledger-p (corner)
|
||||
"Returns T if there is a ledger at this corner"
|
||||
(declare (vars (corner str (member corner '("fl" "fr" "bl" "br"))))
|
||||
with-data)
|
||||
(member (substr (cornerkey "chan_num") 1 1) '("6" "7")))
|
||||
(defun-r 'land-ledger-p)
|
||||
|
||||
(defun combine (ledgers / combo-slice ret found-match-p)
|
||||
(defun combo-slice (lst)
|
||||
(append (slice lst 0 7)
|
||||
(slice lst 9 2)))
|
||||
(setq ret (list (pop! 'ledgers)))
|
||||
(while ledgers
|
||||
(foreach idx (range 0 (length ret) 1)
|
||||
(if (not found-match-p)
|
||||
(if (vl-every 'equal (combo-slice (nth idx ret)) (combo-slice (car ledgers)))
|
||||
(setq found-match-p T
|
||||
ret
|
||||
(append
|
||||
(slice ret 0 idx)
|
||||
((lambda(/ l1 l2)
|
||||
(setq l1 (nth idx ret)
|
||||
l2 (pop! 'ledgers))
|
||||
(foreach key '("qty"
|
||||
"a1-qty"
|
||||
"p1-qty"
|
||||
"p2-qty"
|
||||
"r1-qty"
|
||||
"exp-qty"
|
||||
"screw-qty")
|
||||
(subst-key! key (+ (xd-value key l1) (xd-value key l2)) 'l1))
|
||||
(list l1)))
|
||||
(slice ret (1+ idx) (length ret)))))))
|
||||
(if (not found-match-p)
|
||||
(add-to-list 'ret (pop! 'ledgers)))
|
||||
(setq found-match-p nil))
|
||||
ret)
|
||||
(foreach corner '("fl" "fr" "bl" "br")
|
||||
(if (member (substr (cornerkey "chan_num") 1 1) '("6" "7"))
|
||||
(add-to-list 'ret (calc corner))))
|
||||
(if ret
|
||||
(cons finish
|
||||
(mapcar '(lambda(lst) (mapcar (compose '(to-string cadr)) lst))
|
||||
(mapcar 'cdr (combine ret))))))
|
||||
(defun-q land-ledger-calc (corner / gusset chan)
|
||||
"Calculates the ledger material and hardware for this CORNER of the current landing
|
||||
|
||||
(defun make-land-sl-ledger-fabs (ledger-map)
|
||||
(foreach ledgers ledger-map
|
||||
((lambda(/ finish)
|
||||
(setq finish (pop! 'ledgers))
|
||||
(while ledgers
|
||||
(make-land-sl-ledger-fab finish (take! 60 'ledgers)))))))
|
||||
|
||||
(defun make-land-sl-ledger-fab (finish ledgers / dwgno path login qtys)
|
||||
(setq dwgno (land-fab-calc-sl-dwg-no jobno stairno))
|
||||
(debug-print '("Making ledger fab dwg: " #dwgno))
|
||||
(setq path (vla-get-Path acadDoc)
|
||||
login (getvar 'loginname)
|
||||
acadDoc (vla-Add (vla-get-Documents acadObj)
|
||||
(strcat psc-src-dir "fab/land-ledger.dwt"))
|
||||
modelspace (vla-get-ModelSpace acadDoc))
|
||||
|
||||
(write-title-block job-info stairno login "SHIP LOOSE LEDGERS")
|
||||
;; write finish table
|
||||
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
|
||||
;; write main table
|
||||
(land-fab-write-sl-main-table "Ledger Angles" ledgers '(7 11 12 13 14))
|
||||
;; write quantity summary table
|
||||
(foreach ledger ledgers
|
||||
(repeat (read (nth 6 ledger))
|
||||
(add-to-list 'qtys (strcat (nth 5 ledger) "x8")))
|
||||
(repeat (read (nth 10 ledger))
|
||||
(add-to-list 'qtys (strcat "P1 (" (nth 8 ledger) " x " (nth 9 ledger) ")"))))
|
||||
(land-fab-write-sl-qty-table (count-items (vl-sort qtys 'sort-strings-asc)))
|
||||
|
||||
(vla-Regen acadDoc acAllViewports)
|
||||
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
|
||||
(if (not *dev-mode*) (vla-Close acadDoc))
|
||||
(reset-doc))
|
||||
Assumed to be called by %land-sl--calc"
|
||||
(declare (vars (corner str (member corner '("fl" "fr" "bl" "br"))))
|
||||
with-data)
|
||||
(defun gusset (ang)
|
||||
(setq ang (strsplit (substr ang 2) "x"))
|
||||
(list (frac (- (read (car ang)) 0.5)) (frac (- (read (cadr ang)) 0.5))))
|
||||
(setq chan (cornerkey "chan_num"))
|
||||
;; ledgers
|
||||
(if (= chan "76")
|
||||
;; inverted fixed
|
||||
(add-material
|
||||
'(("qty" 1)
|
||||
("desc" "ANGLE 6 x 4 x 3/8")
|
||||
("length" "8")
|
||||
("note" "SL")))
|
||||
(if (member chan '("60" "61" "62" "70" "71" "72"))
|
||||
;; clip angle ledger
|
||||
(mapcar 'add-material
|
||||
'((("detail" "L1")
|
||||
("qty" 1)
|
||||
("desc" "ANGLE 4 x 4 x 3/8")
|
||||
("length" "8")
|
||||
("note" "SL"))
|
||||
(("detail" "P1")
|
||||
("qty" 2)
|
||||
("desc" "PLATE 1/4")
|
||||
("length" #(car (gusset (cornerkey "angle"))))
|
||||
("width" #(cadr (gusset (cornerkey "angle")))))
|
||||
(("detail" "L1a")
|
||||
("qty" 1)
|
||||
("desc" "ANGLE 4 x 3 x 1/4")
|
||||
("length" "2"))))
|
||||
;; plain ledger
|
||||
(progn
|
||||
(mapcar 'add-material
|
||||
'((("detail" "L2")
|
||||
("qty" 1)
|
||||
("desc" "ANGLE 4 x 4 x 3/8")
|
||||
("length" "8")
|
||||
("note" "SL"))
|
||||
(("detail" "P1")
|
||||
("qty" 2)
|
||||
("desc" "PLATE 1/4")
|
||||
("length" #(car (gusset (cornerkey "angle"))))
|
||||
("width" #(cadr (gusset (cornerkey "angle")))))))
|
||||
(if (begins-with chan "6")
|
||||
;; bent rod clip
|
||||
(add-material
|
||||
'(("detail" "R1")
|
||||
("qty" 1)
|
||||
("desc" "BENT C-SHAPE ROUND BAR 5/8 DIA.")
|
||||
("note" "SL")))))))
|
||||
;; anchors and hardware
|
||||
(if (member chan '("61" "62" "67" "68" "71" "72" "78" "79"))
|
||||
(progn
|
||||
;; anchor plate
|
||||
(add-material
|
||||
'(("detail" "P2")
|
||||
("qty" 1)
|
||||
("desc" "PLATE 3/8")
|
||||
("width" "12")
|
||||
("length" "12")
|
||||
("note" "SL")))
|
||||
(if (member chan '("61" "67" "71" "78"))
|
||||
;; expansion anchors
|
||||
(add-hardware
|
||||
'(("qty" 4)
|
||||
("desc" "HILTI KB-TZ2 WEDGE ANCHOR 5/8 DIA. x 6")
|
||||
("note" "SL")))
|
||||
;; screw anchors
|
||||
(add-hardware
|
||||
'(("qty" 4)
|
||||
("desc" "HILTI KH-EZ SCREW ANCHOR 5/8 DIA. x 5 1/2")
|
||||
("note" "SL")))))))
|
||||
(defun-r 'land-ledger-calc)
|
||||
|
Binary file not shown.
@ -1,125 +1,136 @@
|
||||
(defun calc-land-sl-posts (/ calc combine ret)
|
||||
(expect-with-data "calc-land-sl-posts")
|
||||
|
||||
(defun calc (corner / chan supp xtra xtra-p base)
|
||||
(setq chan (cornerkey "chan_num")
|
||||
supp (cornerkey "supp_num")
|
||||
xtra (cornerkey "xtra_holes")
|
||||
xtra-p (and (> xtra 0)
|
||||
(not (ends-with chan "5")))
|
||||
base (#! '(("chan" #chan)
|
||||
("supp" #supp)
|
||||
("mark" "P")
|
||||
("num" #number)
|
||||
("level" #level)
|
||||
("seq" #sequence))))
|
||||
(append
|
||||
base
|
||||
(#! '(("top-detail" #(if (ends-with chan "5")
|
||||
3
|
||||
(if xtra-p 2 1)))
|
||||
("bot-detail" #(cond
|
||||
((ends-with supp "X") "")
|
||||
((ends-with supp "6") 3)
|
||||
((ends-with supp "1") 2)
|
||||
(T 1)))
|
||||
("material" #(if (begins-with chan "2")
|
||||
"HSS 2 1/2 x 2 1/2 x 1/4"
|
||||
"HSS 3 x 3 x 1/4"))
|
||||
("length" #(frac (- (if (ends-with chan "5")
|
||||
(- (cornerkey "len")
|
||||
flr_thick
|
||||
(if (begins-with corner "f") front_chan_dpt back_chan_dpt)
|
||||
0.25)
|
||||
(- (cornerkey "len") flr_thick))
|
||||
0.25)))
|
||||
("xtra-holes" #(if (> xtra-p 0) xtra ""))
|
||||
("qty" 1)
|
||||
("p1-qty" #(if (member supp '("22" "23" "24")) 1 0))
|
||||
("p2-qty" #(if (member supp '("32" "33" "34")) 1 0))
|
||||
("p3-qty" #(if (= supp "21") 1 0))
|
||||
("p4-qty" #(if (= supp "31") 1 0))
|
||||
("p5-qty" #(+ (if (ends-with chan "5") 1 0)
|
||||
(if (ends-with supp "6") 1 0)))
|
||||
("exp-qty" #(if (or (ends-with supp "1") (ends-with supp "6")) 2 0))
|
||||
("2bolt-qty" #(if (ends-with chan "5") 2 0))
|
||||
("4bolt-qty" #(if (= chan "20") (if xtra-p 4 2) 0))
|
||||
("45bolt-qty" #(if (= chan "30") (if xtra-p 4 2) 0))
|
||||
("nut-qty" #(if xtra-p 4 2))
|
||||
("fwash-qty" #(if (ends-with chan "5") 2 (if xtra-p 8 4)))
|
||||
("lwash-qty" #(if xtra-p 4 2))
|
||||
("bwash-qty" #(if (ends-with chan "5") 2 0))))))
|
||||
|
||||
(defun combine (posts / ret found-match-p)
|
||||
(setq ret (list (pop! 'posts)))
|
||||
(while posts
|
||||
(foreach idx (range 0 (length ret) 1)
|
||||
(if (not found-match-p)
|
||||
(if (vl-every 'equal (slice (car posts) 0 11) (slice (nth idx ret) 0 11))
|
||||
(setq found-match-p T
|
||||
ret
|
||||
(append
|
||||
(slice ret 0 idx)
|
||||
((lambda(/ l1 l2)
|
||||
(setq l1 (nth idx ret)
|
||||
l2 (pop! 'posts))
|
||||
(foreach key '("qty"
|
||||
"p1-qty"
|
||||
"p2-qty"
|
||||
"p3-qty"
|
||||
"p4-qty"
|
||||
"p5-qty"
|
||||
"exp-qty"
|
||||
"2bolt-qty"
|
||||
"4bolt-qty"
|
||||
"45bolt-qty"
|
||||
"nut-qty"
|
||||
"fwash-qty"
|
||||
"lwash-qty"
|
||||
"bwash-qty")
|
||||
(subst-key! key (+ (xd-value key l1) (xd-value key l2)) 'l1))
|
||||
(list l1)))
|
||||
(slice ret (1+ idx) (length ret)))))))
|
||||
(if (not found-match-p)
|
||||
(add-to-list 'ret (pop! 'posts)))
|
||||
(setq found-match-p nil))
|
||||
ret)
|
||||
(foreach corner '("fl" "fr" "bl" "br")
|
||||
(if (member (cornerkey "chan_num") '("20" "25" "30" "35"))
|
||||
(add-to-list 'ret (calc corner))))
|
||||
(if ret
|
||||
(cons finish
|
||||
(mapcar '(lambda(lst) (mapcar (compose '(to-string cadr)) lst))
|
||||
(mapcar 'cddr (combine ret))))))
|
||||
(set-file-docstring "Functions for calculating landing post fabs")
|
||||
|
||||
(defun make-land-sl-post-fabs (post-map)
|
||||
(foreach posts post-map
|
||||
((lambda(/ finish)
|
||||
(setq finish (pop! 'posts))
|
||||
(while posts
|
||||
(make-land-sl-post-fab finish (take! 46 'posts)))))))
|
||||
(defun-q land-post-p (corner)
|
||||
"Returns T if there is a post at this corner"
|
||||
(declare (vars (corner str (member corner '("fl" "fr" "bl" "br"))))
|
||||
with-data)
|
||||
(member (cornerkey "chan_num") '("20" "25" "30" "35")))
|
||||
(defun-r 'land-post-p)
|
||||
|
||||
(defun make-land-sl-post-fab (finish posts / dwgno path login qtys)
|
||||
(setq dwgno (land-fab-calc-sl-dwg-no jobno stairno))
|
||||
(debug-print '("Making post fab dwg: " #dwgno))
|
||||
(setq path (vla-get-Path acadDoc)
|
||||
login (getvar 'loginname)
|
||||
acadDoc (vla-Add (vla-get-Documents acadObj)
|
||||
(strcat psc-src-dir "fab/land-post.dwt"))
|
||||
modelspace (vla-get-ModelSpace acadDoc))
|
||||
(defun-q land-post-calc (corner / chan supp xtra xtra-p bay)
|
||||
"Calculates the post material and hardware for this CORNER of the current landing
|
||||
|
||||
(write-title-block job-info stairno login "SHIP LOOSE POSTS")
|
||||
;; write finish table
|
||||
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
|
||||
;; write main table
|
||||
(land-fab-write-sl-main-table "Landing Posts" posts (range 10 23 1))
|
||||
;; write quantity summary table
|
||||
(foreach post posts
|
||||
(repeat (read (nth 9 post))
|
||||
(add-to-list 'qtys (strcat (nth 6 post) " x " (nth 7 post)))))
|
||||
(land-fab-write-sl-qty-table (count-items (vl-sort qtys 'sort-strings-asc)))
|
||||
Assumed to be called by %land-sl--calc"
|
||||
(declare (vars (corner str (member corner '("fl" "fr" "bl" "br"))))
|
||||
with-data)
|
||||
(setq chan (cornerkey "chan_num")
|
||||
supp (cornerkey "supp_num")
|
||||
xtra (cornerkey "xtra_holes")
|
||||
xtra-p (and (> xtra 0)
|
||||
(not (ends-with chan "5")))
|
||||
bay (xd-value corner '(("fl" "f")
|
||||
("fr" "r")
|
||||
("br" "b")
|
||||
("bl" "l"))))
|
||||
;; post
|
||||
(add-material
|
||||
'(("detail" #(strcat "T"
|
||||
(if (ends-with chan "5") "3" (if xtra-p "2" "1"))
|
||||
"/B"
|
||||
(cond ((ends-with supp "6") "3")
|
||||
((ends-with supp "1") "2")
|
||||
(T "1"))))
|
||||
("qty" 1)
|
||||
("desc" #(if (begins-with chan "2")
|
||||
"HSS 2 1/2 x 2 1/2 x 1/4"
|
||||
"HSS 3 x 3 x 1/4"))
|
||||
("length" #(frac (- (if (ends-with chan "5")
|
||||
(- (cornerkey "len")
|
||||
flr_thick
|
||||
(if (begins-with corner "f") front_chan_dpt back_chan_dpt)
|
||||
0.25)
|
||||
(- (cornerkey "len") flr_thick))
|
||||
0.25)))
|
||||
("note" "SL")
|
||||
("extra_holes_offset" #(if xtra-p xtra ""))))
|
||||
;; chan
|
||||
(if (ends-with chan "0")
|
||||
(mapcar 'add-hardware
|
||||
;; hex bolt
|
||||
'((("qty" #(if xtra-p 4 2))
|
||||
("desc" #(strcat "HEX BOLT (A307) 5/8 DIA. x "
|
||||
(if (begins-with chan "2") "4" "4 1/2")))
|
||||
("note" "SL"))
|
||||
(("qty" #(if xtra-p 4 2))
|
||||
("desc" "HEX NUT 5/8 DIA.")
|
||||
("note" "SL"))
|
||||
(("qty" #(if xtra-p 4 2))
|
||||
("desc" "LOCK WASHER 5/8 DIA.")
|
||||
("note" "SL"))
|
||||
(("qty" #(if xtra-p 8 4))
|
||||
("desc" "FLAT WASHER 5/8 DIA.")
|
||||
("note" "SL"))))
|
||||
(progn
|
||||
;; superman plate
|
||||
(add-material
|
||||
'(("detail" "P2")
|
||||
("qty" 1)
|
||||
("desc" "PLATE 1/4")
|
||||
("width" "6")
|
||||
("length" "6")))
|
||||
(mapcar 'add-hardware
|
||||
'((("qty" 2)
|
||||
("desc" "HEX BOLT (A307) 5/8 DIA. x 2")
|
||||
("note" "SL"))
|
||||
(("qty" 2)
|
||||
("desc" "FLAT WASHER 5/8 DIA.")
|
||||
("note" "SL"))
|
||||
(("qty" 2)
|
||||
("desc" "BEVEL WASHER 5/8 DIA.")
|
||||
("note" "SL"))))))
|
||||
;; supp
|
||||
(if (or (ends-with supp "1")
|
||||
(ends-with supp "6"))
|
||||
(progn
|
||||
;; expansion anchors
|
||||
(add-hardware
|
||||
'(("qty" 2)
|
||||
("desc" "HILTI KB-TZ2 WEDGE ANCHOR 5/8 DIA. x 4 3/4")
|
||||
("note" "SL")))
|
||||
(if (ends-with supp "6")
|
||||
(add-material
|
||||
'(("detail" "P2")
|
||||
("qty" 1)
|
||||
("desc" "PLATE 1/4")
|
||||
("width" "6")
|
||||
("length" "6")))
|
||||
;; long base plate
|
||||
(add-material
|
||||
'(("detail" "P1")
|
||||
("qty" 1)
|
||||
("desc" #(strcat "FLAT BAR 1/4 x " (if (begins-with chan "2") "3" "3 1/2")))
|
||||
("length" "9")))))
|
||||
;; square base plate
|
||||
(add-material
|
||||
'(("detail" "B1a")
|
||||
("qty" 1)
|
||||
("desc" #(strcat "FLAT BAR 1/4 x " (if (begins-with chan "2") "3" "3 1/2")))
|
||||
("length" #(if (begins-with chan "2") "3" "3 1/2")))))
|
||||
;; x bracing
|
||||
(if (= (symcat '(#(substr bay 1 1) "_brace")) "1")
|
||||
(mapcar 'add-material (land-post--xbrace-material bay))))
|
||||
(defun-r 'land-post-calc)
|
||||
|
||||
(vla-Regen acadDoc acAllViewports)
|
||||
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
|
||||
(if (not *dev-mode*) (vla-Close acadDoc))
|
||||
(reset-doc))
|
||||
(defun-q land-post--xbrace-material (bay / hgt wid npanels len ang ret)
|
||||
"Return the material for X-bracing at BAY"
|
||||
(declare (vars (bay str (member bay '("f" "b" "l" "r"))))
|
||||
with-data)
|
||||
(foreach key '("hgt" "wid" "npanels")
|
||||
(set (read key) (symcat '(#bay "_brace_" #key))))
|
||||
(setq wid (- wid 0.25)
|
||||
hgt (- hgt 12.0)
|
||||
ang (rtos (rtd (atan (/ hgt wid))) 2 0)
|
||||
len (frac (sqrt (+ (square wid) (square hgt)))))
|
||||
(add-to-list 'ret (#! '(("detail" "X1")
|
||||
("qty" #(* npanels 2))
|
||||
("desc" "HSS 2 1/2 x 1 1/2 x 1/4")
|
||||
("length" #len)
|
||||
("miter_angle" #ang)
|
||||
("note" "SL"))))
|
||||
(if (> npanels 1)
|
||||
(add-to-list 'ret (#! '(("qty" #(1- npanels))
|
||||
("desc" "HSS 3 x 3 x 1/4")
|
||||
("length" #(frac wid))
|
||||
("note" "SL")))))
|
||||
ret)
|
||||
(defun-r 'land-post--xbrace-material)
|
||||
|
Binary file not shown.
@ -1,94 +0,0 @@
|
||||
(defun calc-land-sl-xbraces (/ calc combine ret)
|
||||
(expect-with-data "calc-land-sl-xbraces")
|
||||
|
||||
(defun calc (bay / hgt wid npanels len ang ret)
|
||||
(foreach key '("hgt" "wid" "npanels")
|
||||
(set (read key) (symcat '(#bay "_brace_" #key))))
|
||||
(setq wid (- wid 0.25)
|
||||
hgt (- hgt 12.0)
|
||||
ang (strcat (rtos (rtd (atan (/ hgt wid))) 2 0) "%%d")
|
||||
len (frac (sqrt (+ (square wid) (square hgt))))
|
||||
base (#! '(("mark" "P")
|
||||
("num" #number)
|
||||
("level" #level)
|
||||
("seq" #sequence))))
|
||||
(add-to-list 'ret (append base
|
||||
(#! '(("detail" "1")
|
||||
("qty" #(* npanels 2))
|
||||
("cut-len" #len)
|
||||
("miter-ang" #ang)))))
|
||||
(if (> npanels 1)
|
||||
(add-to-list 'ret (append base
|
||||
(#! '(("detail" "2")
|
||||
("qty" #(1- npanels))
|
||||
("cut-len" #(frac wid))
|
||||
("miter-ang" ""))))))
|
||||
ret)
|
||||
|
||||
(defun combine (braces / ret found-match-p)
|
||||
(debug-print-vars '(braces))
|
||||
(setq ret (list (pop! 'braces)))
|
||||
(while braces
|
||||
(foreach idx (range 0 (length ret) 1)
|
||||
(if (not found-match-p)
|
||||
(if (vl-every 'equal (nth idx ret) (car braces))
|
||||
(setq found-match-p T
|
||||
ret (append (slice ret 0 idx)
|
||||
(list (subst-key "qty"
|
||||
(+ (xd-value "qty" (nth idx ret))
|
||||
(xd-value "qty" (pop! 'braces)))
|
||||
(nth idx ret)))
|
||||
(slice ret (1+ idx) (length ret)))))))
|
||||
(if (not found-match-p)
|
||||
(add-to-list 'ret (pop! 'braces)))
|
||||
(setq found-match-p nil))
|
||||
(debug-print-vars '(ret))
|
||||
ret)
|
||||
|
||||
(foreach bay '("f" "b" "l" "r")
|
||||
(if (= (symcat '(#(substr bay 1 1) "_brace")) "1")
|
||||
(add-to-list 'ret (calc bay))))
|
||||
(if ret
|
||||
(cons finish
|
||||
(mapcar '(lambda(lst) (mapcar (compose '(to-string cadr)) lst))
|
||||
(combine (apply 'append ret))))))
|
||||
|
||||
(defun make-land-sl-xbrace-fabs (brace-map)
|
||||
(foreach braces brace-map
|
||||
((lambda(/ finish)
|
||||
(setq finish (pop! 'braces))
|
||||
(while braces
|
||||
(make-land-sl-xbrace-fab finish (take! 141 'braces)))))))
|
||||
|
||||
(defun make-land-sl-xbrace-fab (finish braces / dwgno path login qtys)
|
||||
(setq dwgno (land-fab-calc-sl-dwg-no jobno stairno))
|
||||
(debug-print '("Making x-brace fab dwg: " #dwgno))
|
||||
(setq path (vla-get-Path acadDoc)
|
||||
login (getvar 'loginname)
|
||||
acadDoc (vla-Add (vla-get-Documents acadObj)
|
||||
(strcat psc-src-dir "fab/land-xbrace.dwt"))
|
||||
modelspace (vla-get-ModelSpace acadDoc))
|
||||
|
||||
(write-title-block job-info stairno login "CROSS BRACING")
|
||||
;; write finish table
|
||||
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
|
||||
;; write main table
|
||||
(land-fab-write-sl-main-table "Cross Bracing" braces nil)
|
||||
;; write quantity summary table
|
||||
(foreach brace braces
|
||||
(repeat (read (nth 5 brace))
|
||||
((lambda (/ miter-p)
|
||||
(setq miter-p (= (nth 4 brace) "1"))
|
||||
(add-to-list 'qtys (if miter-p
|
||||
(strcat "HSS 2 1/2 x 1 1/2 x 1/4 x "
|
||||
(nth 6 brace)
|
||||
" @ "
|
||||
(nth 7 brace))
|
||||
(strcat "HSS 3 x 3 x 1/4 x "
|
||||
(nth 6 brace))))))))
|
||||
(land-fab-write-sl-qty-table (count-items (vl-sort qtys 'sort-strings-asc)))
|
||||
|
||||
(vla-Regen acadDoc acAllViewports)
|
||||
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
|
||||
(if (not *dev-mode*) (vla-Close acadDoc))
|
||||
(reset-doc))
|
Can't render this file because it has a wrong number of fields in line 255.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue