pete
/
psc
1
0
Fork 0

Merge remote-tracking branch 'remotes/gitlab/master' into dd-dev

master
Dennis Dreischmeyer 2 months ago
commit 8bd6f757df

@ -1,6 +1,6 @@
(set-file-docstring "Function for modeling 3d guardrails")
(psc-include '("3d/3d-model.lsp" "rail/guard-rail.lsp"))
(psc-include '("3D/3d-model.lsp" "rail/guard-rail.lsp"))
(defun-q draw-3d_guard (dat ins / blk def 3d-p)
"Creates a 3d block of a guardrail via passed xdata and insert"

@ -150,9 +150,8 @@ themselves after first run."
("dumpstairs.lsp" "DUMPSTAIRS")
("dumplands.lsp" "DUMPLANDS")
("editblock.lsp" "EDITBLOCK")
("editmaterial.lsp" "EDITMATERIAL")
("edithardware.lsp" "EDITHARDWARE")
("editfinish.lsp" "EDITFINISH")
("edittable.lsp" "EDITTABLE")
("embed.lsp" "EMBED")
("embed-totals.lsp" "EMBED-TOTALS")
("endview.lsp" "ENDVIEW")

@ -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)

@ -19,11 +19,6 @@
<tbody>
<tr>
<td class="funcsig"><a href="3D-3d-stair.html#3dg-def">(<span class="funcname">3dg-def</span> side t/b)</a></td>
<td>generates guard def based on passed side and t/b</td>
</tr>
<tr>
<td class="funcsig"><a href="3D-3d-stair.html#3dr-add">(<span class="funcname">3dr-add</span> name def)</a></td>
<td>Creates a 3d block of a stair rail or wall rail based on passed rail definition</td>
@ -39,25 +34,11 @@
<td>Creates a 3d block of a stair via passed xdata and insert</td>
</tr>
<tr>
<td class="funcsig"><a href="3D-3d-stair.html#draw-gbtwn">(<span class="funcname">draw-gbtwn</span>)</a></td>
<td>Creates a 3d block of a guard between stairs based on xdata and insert of stair block</td>
</tr>
</tbody>
</table>
<section>
<h3 id="3dg-def" class="funcsig">(<span class="funcname">3dg-def</span> side t/b)</h3>
<pre class="fulldoc">generates guard def based on passed side and t/b
VARS:
(SIDE STR (MEMBER SIDE '("i" "o")))
(T/B STR (MEMBER T/B '("bot" "top")))</pre>
</section>
<section>
<h3 id="3dr-add" class="funcsig">(<span class="funcname">3dr-add</span> name def)</h3>
<pre class="fulldoc">Creates a 3d block of a stair rail or wall rail based on passed rail definition
@ -85,13 +66,6 @@ VARS:
(INS LIST (POINT-P INS))</pre>
</section>
<section>
<h3 id="draw-gbtwn" class="funcsig">(<span class="funcname">draw-gbtwn</span>)</h3>
<pre class="fulldoc">Creates a 3d block of a guard between stairs based on xdata and insert of stair block
WITH-DATA</pre>
</section>
</div>
</body>

@ -55,7 +55,7 @@
</tr>
<tr>
<td class="funcsig"><a href="embed-dialog.html#multi-embed-dialog">(<span class="funcname">multi-embed-dialog</span> dat)</a></td>
<td class="funcsig"><a href="embed-dialog.html#multi-embed-dialog">(<span class="funcname">multi-embed-dialog</span>)</a></td>
<td>Embed dialog functions for batch editing</td>
</tr>
@ -110,7 +110,7 @@
</section>
<section>
<h3 id="multi-embed-dialog" class="funcsig">(<span class="funcname">multi-embed-dialog</span> dat)</h3>
<h3 id="multi-embed-dialog" class="funcsig">(<span class="funcname">multi-embed-dialog</span>)</h3>
<pre class="fulldoc">Embed dialog functions for batch editing</pre>
</section>

@ -43,7 +43,8 @@
<h3 id="calc-closure-plate" class="funcsig">(<span class="funcname">calc-closure-plate</span> s1 s2)</h3>
<pre class="fulldoc">Returns the closure plate definition for the plate between stairs S1 and S2
The format is a list of strings matching the table in the template.</pre>
The return value will be a list whose car is the finish string and cdr is a datalist for
the table.</pre>
</section>
<section>
@ -52,7 +53,7 @@ The format is a list of strings matching the table in the template.</pre>
VARS:
(FINISH STR)
(PLATES LIST (VL-EVERY 'LIST-OF-STRINGS-P PLATES))</pre>
(PLATES LIST (VL-EVERY 'DATA-LIST-P PLATES))</pre>
</section>
<section>

@ -9,7 +9,9 @@
<div id="content">
<h2>fab/data-export.lsp <a href="../../fab/data-export.lsp">[src]</a></h2>
<pre class="fulldoc">Support functions for FABDATA</pre>
<pre class="fulldoc">Support functions for FABDATA
For scoping, every function here expects to be called by <a href="fab-data-export.html#fabdata-process-dwgs">fabdata-process-dwgs</a></pre>
<table>
<thead>
<h3>Functions</h3>
@ -21,77 +23,62 @@
<tr><td colspan="3">Public</td></tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata-combine">(<span class="funcname">fabdata-combine</span> lst)</a></td>
<td>Combines identical line items in main fabdata</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata-process-dwg">(<span class="funcname">fabdata-process-dwg</span> filename)</a></td>
<td>Opens a fab drawing and calls the appropriate processing function to extract data</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata-process-dwgs">(<span class="funcname">fabdata-process-dwgs</span> files)</a></td>
<td>Processes all FILES for fab data information and writes it to a .csv</td>
<td>Processes all FILES using <a href="fab-data-export.html#fabdata--process-dwg">fabdata--process-dwg</a> and writes result to a .csv</td>
</tr>
<tr><td colspan="3">Private</td></tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-closure-plate">(<span class="funcname">fabdata--process-closure-plate</span> dwg)</a></td>
<td>Processes a closure plate drawing</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-generic">(<span class="funcname">fabdata--process-generic</span> dwg)</a></td>
<td>Processes a generic fab drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--format-hardware">(<span class="funcname">fabdata--format-hardware</span> hdw)</a></td>
<td>Adds hardware code and makes qty an integer</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-generic-ship-loose">(<span class="funcname">fabdata--process-generic-ship-loose</span> dwg)</a></td>
<td>Processes a generic ship loose drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--get-hardware-code">(<span class="funcname">fabdata--get-hardware-code</span> desc)</a></td>
<td>Returns the short code for a hardware description, if it exists, or an empty string</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-land-hanger">(<span class="funcname">fabdata--process-land-hanger</span> dwg)</a></td>
<td>Processes a ship loose landing hangers drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--get-material-code">(<span class="funcname">fabdata--get-material-code</span> desc)</a></td>
<td>Returns the short code for a material description, if it exists, or an empty string</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-land-ledger">(<span class="funcname">fabdata--process-land-ledger</span> dwg)</a></td>
<td>Processes a ship loose landing ledger drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--mat-table-total-weight">(<span class="funcname">fabdata--mat-table-total-weight</span> table)</a></td>
<td>Returns the total weight</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-land-post">(<span class="funcname">fabdata--process-land-post</span> dwg)</a></td>
<td>Processes a ship loose landing posts drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-assemblies">(<span class="funcname">fabdata--process-assemblies</span> table)</a></td>
<td>Processes an Assembly* table for assemblies</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-land-xbrace">(<span class="funcname">fabdata--process-land-xbrace</span> dwg)</a></td>
<td>Processes a cross-bracing drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-assembly-material">(<span class="funcname">fabdata--process-assembly-material</span> table)</a></td>
<td>Processes a Material table (paired with an Assembly* table) for ship loose items</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-return">(<span class="funcname">fabdata--process-return</span> dwg)</a></td>
<td>Processes a handrail return drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-bracket-hardware">(<span class="funcname">fabdata--process-bracket-hardware</span> table)</a></td>
<td>Processes a legacy Bracket Hardware table</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-spreadsheet">(<span class="funcname">fabdata--process-spreadsheet</span> table-name first-row)</a></td>
<td>Generic processor for spreadsheet style drawings</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-dwg">(<span class="funcname">fabdata--process-dwg</span> filename)</a></td>
<td>Opens a fab drawing and processes all the tables</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-stair-rail">(<span class="funcname">fabdata--process-stair-rail</span> dwg)</a></td>
<td>Processes a stair rail drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-hardware">(<span class="funcname">fabdata--process-hardware</span> table)</a></td>
<td>Processes a *Hardware table for ship loose entries</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-wall-rail">(<span class="funcname">fabdata--process-wall-rail</span> dwg)</a></td>
<td>Processes a wall rail drawing</td>
<td class="funcsig"><a href="fab-data-export.html#fabdata--process-misc-material">(<span class="funcname">fabdata--process-misc-material</span> table)</a></td>
<td>Processes a Misc Material table for ship loose items</td>
</tr>
@ -99,77 +86,95 @@
</table>
<section>
<h3 id="fabdata-combine" class="funcsig">(<span class="funcname">fabdata-combine</span> lst)</h3>
<pre class="fulldoc">Combines identical line items in main fabdata</pre>
</section>
<section>
<h3 id="fabdata-process-dwg" class="funcsig">(<span class="funcname">fabdata-process-dwg</span> filename)</h3>
<pre class="fulldoc">Opens a fab drawing and calls the appropriate processing function to extract data</pre>
</section>
<section>
<h3 id="fabdata-process-dwgs" class="funcsig">(<span class="funcname">fabdata-process-dwgs</span> files)</h3>
<pre class="fulldoc">Processes all FILES for fab data information and writes it to a .csv</pre>
</section>
<section>
<h3 id="fabdata--process-closure-plate" class="funcsig">(<span class="funcname">fabdata--process-closure-plate</span> dwg)</h3>
<pre class="fulldoc">Processes a closure plate drawing</pre>
<pre class="fulldoc">Processes all FILES using <a href="fab-data-export.html#fabdata--process-dwg">fabdata--process-dwg</a> and writes result to a .csv
VARS:
(FILES LIST (VL-EVERY 'STRINGP FILES))</pre>
</section>
<section>
<h3 id="fabdata--process-generic" class="funcsig">(<span class="funcname">fabdata--process-generic</span> dwg)</h3>
<pre class="fulldoc">Processes a generic fab drawing</pre>
<h3 id="fabdata--format-hardware" class="funcsig">(<span class="funcname">fabdata--format-hardware</span> hdw)</h3>
<pre class="fulldoc">Adds hardware code and makes qty an integer
VARS:
(HDW LIST (DATA-LIST-P HDW))</pre>
</section>
<section>
<h3 id="fabdata--process-generic-ship-loose" class="funcsig">(<span class="funcname">fabdata--process-generic-ship-loose</span> dwg)</h3>
<pre class="fulldoc">Processes a generic ship loose drawing</pre>
<h3 id="fabdata--get-hardware-code" class="funcsig">(<span class="funcname">fabdata--get-hardware-code</span> desc)</h3>
<pre class="fulldoc">Returns the short code for a hardware description, if it exists, or an empty string
VARS:
(DESC STR)</pre>
</section>
<section>
<h3 id="fabdata--process-land-hanger" class="funcsig">(<span class="funcname">fabdata--process-land-hanger</span> dwg)</h3>
<pre class="fulldoc">Processes a ship loose landing hangers drawing</pre>
<h3 id="fabdata--get-material-code" class="funcsig">(<span class="funcname">fabdata--get-material-code</span> desc)</h3>
<pre class="fulldoc">Returns the short code for a material description, if it exists, or an empty string
VARS:
(DESC STR)</pre>
</section>
<section>
<h3 id="fabdata--process-land-ledger" class="funcsig">(<span class="funcname">fabdata--process-land-ledger</span> dwg)</h3>
<pre class="fulldoc">Processes a ship loose landing ledger drawing</pre>
<h3 id="fabdata--mat-table-total-weight" class="funcsig">(<span class="funcname">fabdata--mat-table-total-weight</span> table)</h3>
<pre class="fulldoc">Returns the total weight
Calculates the total based on row weight values; does not rely on summary row.
VARS:
(TABLE VLA-OBJECT (MATERIAL-TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="fabdata--process-land-post" class="funcsig">(<span class="funcname">fabdata--process-land-post</span> dwg)</h3>
<pre class="fulldoc">Processes a ship loose landing posts drawing</pre>
<h3 id="fabdata--process-assemblies" class="funcsig">(<span class="funcname">fabdata--process-assemblies</span> table)</h3>
<pre class="fulldoc">Processes an Assembly* table for assemblies
Attempts to set the piece weight using the Material table.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="fabdata--process-land-xbrace" class="funcsig">(<span class="funcname">fabdata--process-land-xbrace</span> dwg)</h3>
<pre class="fulldoc">Processes a cross-bracing drawing</pre>
<h3 id="fabdata--process-assembly-material" class="funcsig">(<span class="funcname">fabdata--process-assembly-material</span> table)</h3>
<pre class="fulldoc">Processes a Material table (paired with an Assembly* table) for ship loose items
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="fabdata--process-return" class="funcsig">(<span class="funcname">fabdata--process-return</span> dwg)</h3>
<pre class="fulldoc">Processes a handrail return drawing</pre>
<h3 id="fabdata--process-bracket-hardware" class="funcsig">(<span class="funcname">fabdata--process-bracket-hardware</span> table)</h3>
<pre class="fulldoc">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</pre>
</section>
<section>
<h3 id="fabdata--process-spreadsheet" class="funcsig">(<span class="funcname">fabdata--process-spreadsheet</span> table-name first-row)</h3>
<pre class="fulldoc">Generic processor for spreadsheet style drawings
<h3 id="fabdata--process-dwg" class="funcsig">(<span class="funcname">fabdata--process-dwg</span> filename)</h3>
<pre class="fulldoc">Opens a fab drawing and processes all the tables
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).</pre>
VARS:
(FILENAME STR)</pre>
</section>
<section>
<h3 id="fabdata--process-stair-rail" class="funcsig">(<span class="funcname">fabdata--process-stair-rail</span> dwg)</h3>
<pre class="fulldoc">Processes a stair rail drawing</pre>
<h3 id="fabdata--process-hardware" class="funcsig">(<span class="funcname">fabdata--process-hardware</span> table)</h3>
<pre class="fulldoc">Processes a *Hardware table for ship loose entries
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="fabdata--process-wall-rail" class="funcsig">(<span class="funcname">fabdata--process-wall-rail</span> dwg)</h3>
<pre class="fulldoc">Processes a wall rail drawing</pre>
<h3 id="fabdata--process-misc-material" class="funcsig">(<span class="funcname">fabdata--process-misc-material</span> table)</h3>
<pre class="fulldoc">Processes a Misc Material table for ship loose items
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>

@ -174,7 +174,7 @@ VARS:
VARS:
(FINISH STR)
(RETURNS LIST (VL-EVERY 'LIST-OF-STRINGS-P RETURNS))</pre>
(RETURNS LIST (VL-EVERY 'DATA-LIST-P RETURNS))</pre>
</section>
<section>
@ -183,7 +183,7 @@ VARS:
VARS:
(FINISH STR)
(RETURNS LIST (VL-EVERY 'LIST-OF-STRINGS-P RETURNS))</pre>
(RETURNS LIST (VL-EVERY 'DATA-LIST-P RETURNS))</pre>
</section>
<section>

@ -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>

@ -102,7 +102,7 @@ VARS:
<h3 id="fab-stringer--add-detail" class="funcsig">(<span class="funcname">fab-stringer--add-detail</span> blkins side mark)</h3>
<pre class="fulldoc">Adds a single stringer detail for SIDE at BLKINS
Adds material to STRINGER-MATERIAL an cap material to CAPS
Adds material to STRINGER-MATERIAL and cap material to CAPS
VARS:
(BLKINS LIST)

@ -24,11 +24,6 @@
<td>Returns the next available fab drawing number with this SIGIL</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#calc-weight-formula">(<span class="funcname">calc-weight-formula</span> description)</a></td>
<td>Returns the weight formula for a material description</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#fab-combine-like-data">(<span class="funcname">fab-combine-like-data</span> data-lists keys)</a></td>
<td>Returns groups of similar datalists for fab drawing consolidation</td>
@ -39,6 +34,21 @@
<td>Gets a list of fab drawing types via dialog</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#get-finish">(<span class="funcname">get-finish</span>)</a></td>
<td>Returns the finish from the finish table or nil if no finish table found</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#get-hardware">(<span class="funcname">get-hardware</span>)</a></td>
<td>Prompts the user to choose a hardware description via dialog and returns it</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#get-material">(<span class="funcname">get-material</span>)</a></td>
<td>Prompts the user to choose a material description via dialog and returns it</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#make-fab-dwgs">(<span class="funcname">make-fab-dwgs</span> types enames)</a></td>
<td>Makes all the TYPES of fab drawings using data from ENAMES</td>
@ -59,6 +69,11 @@
<td>Returns the next available mark prefix and increments it</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#set-finish">(<span class="funcname">set-finish</span> value)</a></td>
<td>Sets the finish in the finish table to VALUE</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#write-title-block">(<span class="funcname">write-title-block</span> job-info stairno login style)</a></td>
<td>Rewrites special text objects in a fab drawing title block</td>
@ -79,14 +94,6 @@ VARS:
(SIGIL STR)</pre>
</section>
<section>
<h3 id="calc-weight-formula" class="funcsig">(<span class="funcname">calc-weight-formula</span> description)</h3>
<pre class="fulldoc">Returns the weight formula for a material description
VARS:
(DESCRIPTION STR)</pre>
</section>
<section>
<h3 id="fab-combine-like-data" class="funcsig">(<span class="funcname">fab-combine-like-data</span> data-lists keys)</h3>
<pre class="fulldoc">Returns groups of similar datalists for fab drawing consolidation
@ -99,6 +106,21 @@ Similarity is based on equivalence of the values of all keys in KEYS.</pre>
<pre class="fulldoc">Gets a list of fab drawing types via dialog</pre>
</section>
<section>
<h3 id="get-finish" class="funcsig">(<span class="funcname">get-finish</span>)</h3>
<pre class="fulldoc">Returns the finish from the finish table or nil if no finish table found</pre>
</section>
<section>
<h3 id="get-hardware" class="funcsig">(<span class="funcname">get-hardware</span>)</h3>
<pre class="fulldoc">Prompts the user to choose a hardware description via dialog and returns it</pre>
</section>
<section>
<h3 id="get-material" class="funcsig">(<span class="funcname">get-material</span>)</h3>
<pre class="fulldoc">Prompts the user to choose a material description via dialog and returns it</pre>
</section>
<section>
<h3 id="make-fab-dwgs" class="funcsig">(<span class="funcname">make-fab-dwgs</span> types enames)</h3>
<pre class="fulldoc">Makes all the TYPES of fab drawings using data from ENAMES</pre>
@ -128,6 +150,16 @@ closes the drawing.</pre>
<pre class="fulldoc">Returns the next available mark prefix and increments it</pre>
</section>
<section>
<h3 id="set-finish" class="funcsig">(<span class="funcname">set-finish</span> value)</h3>
<pre class="fulldoc">Sets the finish in the finish table to VALUE
Returns VALUE if successful or nil if no finish table found
VARS:
(VALUE STR)</pre>
</section>
<section>
<h3 id="write-title-block" class="funcsig">(<span class="funcname">write-title-block</span> job-info stairno login style)</h3>
<pre class="fulldoc">Rewrites special text objects in a fab drawing title block</pre>

@ -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

@ -78,6 +78,26 @@
<td>Functions for handrail return fab drawings</td>
</tr>
<tr>
<td><a href="./fab-land-hanger.html">fab/land-hanger.lsp</a></td>
<td>Functions for calculating landing hanger fabs</td>
</tr>
<tr>
<td><a href="./fab-land-ledger.html">fab/land-ledger.lsp</a></td>
<td>Functions for making landing ledger fabs</td>
</tr>
<tr>
<td><a href="./fab-land-post.html">fab/land-post.lsp</a></td>
<td>Functions for calculating landing post fabs</td>
</tr>
<tr>
<td><a href="./fab-land-ship-loose.html">fab/land-ship-loose.lsp</a></td>
<td>Functions for ship loose landing fabs</td>
</tr>
<tr>
<td><a href="./fab-land.html">fab/land.lsp</a></td>
<td>Functions for landing fab drawings</td>
@ -88,6 +108,11 @@
<td>Functions related to pans in fab drawings</td>
</tr>
<tr>
<td><a href="./fab-stair-rail.html">fab/stair-rail.lsp</a></td>
<td>Functions for stair rail fabs</td>
</tr>
<tr>
<td><a href="./fab-stair-stringer.html">fab/stair-stringer.lsp</a></td>
<td>Functions dealing with stringers in fab drawings</td>
@ -103,6 +128,11 @@
<td>Fab drawing utility functions</td>
</tr>
<tr>
<td><a href="./fab-wall-rail.html">fab/wall-rail.lsp</a></td>
<td>Functions for wall rail fabs</td>
</tr>
<tr>
<td><a href="./land-endview.html">land/endview.lsp</a></td>
<td>Functions for drawing landing end views</td>
@ -118,6 +148,11 @@
<td>Utility functions for landings</td>
</tr>
<tr>
<td><a href="./rail-guard-rail.html">rail/guard-rail.lsp</a></td>
<td></td>
</tr>
<tr>
<td><a href="./rail-rail-section.html">rail/rail-section.lsp</a></td>
<td>Functions for creating a rail section</td>
@ -193,11 +228,6 @@
<td>Functions related to basic math</td>
</tr>
<tr>
<td><a href="./util-bug.html">util/bug.lsp</a></td>
<td>Support functions for BUGREPORT and FEATUREREQ</td>
</tr>
<tr>
<td><a href="./util-comparison.html">util/comparison.lsp</a></td>
<td>Functions related to comparisons</td>
@ -323,7 +353,7 @@
<table>
<thead>
<h3>Public Functions A-Z (660 documented)</h3>
<h3>Public Functions A-Z (709 documented)</h3>
<th>Function Signature</th>
<th>Description</th>
</thead>
@ -351,6 +381,10 @@
<tr>
<td class="funcsig"><a href="util-list.html#2-item-list">(<span class="funcname">2-item-list</span> lst)</a></td>
<td>Returns the elements of LST grouped by twos</td>
@ -436,13 +470,6 @@
<tr>
<td class="funcsig"><a href="3D-3d-stair.html#3dg-def">(<span class="funcname">3dg-def</span> side t/b)</a></td>
<td>generates guard def based on passed side and t/b</td>
</tr>
<tr>
<td class="funcsig"><a href="3D-3d-stair.html#3dr-add">(<span class="funcname">3dr-add</span> name def)</a></td>
<td>Creates a 3d block of a stair rail or wall rail based on passed rail definition</td>
@ -562,6 +589,13 @@
<tr>
<td class="funcsig"><a href="util-object.html#add-cope">(<span class="funcname">add-cope</span> vtx vec)</a></td>
<td>Called from <a href="util-object.html#add-calcd-pipe">add-calcd-pipe</a> when a cope definition is included in the points list.</td>
</tr>
<tr>
<td class="funcsig"><a href="shapes-decking.html#add-decking">(<span class="funcname">add-decking</span> add-to pt1 pt2)</a></td>
<td>adds decking to passed container between two passed points</td>
@ -908,20 +942,6 @@
<tr>
<td class="funcsig"><a href="util-bug.html#bug-get-title">(<span class="funcname">bug-get-title</span> prompt)</a></td>
<td>Gets the title of a bug report from the user, refusing nil, and calls <a href="util-string.html#escape-url">escape-url</a> on it</td>
</tr>
<tr>
<td class="funcsig"><a href="util-bug.html#bug-open-email-template">(<span class="funcname">bug-open-email-template</span> subject body)</a></td>
<td>Opens an email template in Outlook, addressed to Gitlab ticket system</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-handrail-return.html#calc-aa-or-ah-return">(<span class="funcname">calc-aa-or-ah-return</span> s1 s2 aa-p)</a></td>
<td>Common function for calculating returns with a rotation</td>
@ -1106,6 +1126,34 @@
<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="rail-util.html#calc-stair-rail-opcl">(<span class="funcname">calc-stair-rail-opcl</span> side)</a></td>
<td>Returns the outer post centerline length of a stair rail</td>
</tr>
@ -1117,8 +1165,8 @@
<tr>
<td class="funcsig"><a href="fab-util.html#calc-weight-formula">(<span class="funcname">calc-weight-formula</span> description)</a></td>
<td>Returns the weight formula for a material description</td>
<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>
@ -1217,6 +1265,27 @@
<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-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="util-function.html#compose">(<span class="funcname">compose</span> funcs-lst)</a></td>
<td>Returns a lambda that is the result of composing functions in FUNCS-LST</td>
@ -1669,13 +1738,6 @@
<tr>
<td class="funcsig"><a href="3D-3d-stair.html#draw-gbtwn">(<span class="funcname">draw-gbtwn</span>)</a></td>
<td>Creates a 3d block of a guard between stairs based on xdata and insert of stair block</td>
</tr>
<tr>
<td class="funcsig"><a href="land-land_supp.html#draw-land-support">(<span class="funcname">draw-land-support</span> view)</a></td>
<td>Add landing support objects to a block container</td>
@ -1864,28 +1926,12 @@
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata-combine">(<span class="funcname">fabdata-combine</span> lst)</a></td>
<td>Combines identical line items in main fabdata</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata-process-dwg">(<span class="funcname">fabdata-process-dwg</span> filename)</a></td>
<td>Opens a fab drawing and calls the appropriate processing function to extract data</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-data-export.html#fabdata-process-dwgs">(<span class="funcname">fabdata-process-dwgs</span> files)</a></td>
<td>Processes all FILES for fab data information and writes it to a .csv</td>
<td>Processes all FILES using <a href="fab-data-export.html#fabdata--process-dwg">fabdata--process-dwg</a> and writes result to a .csv</td>
</tr>
@ -2017,8 +2063,8 @@
<tr>
<td class="funcsig"><a href="rail-util.html#gen-guard-btw-data">(<span class="funcname">gen-guard-btw-data</span>)</a></td>
<td>generates generic xdata for guard between stairs</td>
<td class="funcsig"><a href="util-object-table.html#get-all-tables">(<span class="funcname">get-all-tables</span>)</a></td>
<td>Returns a list of all tables</td>
</tr>
@ -2065,6 +2111,20 @@
<tr>
<td class="funcsig"><a href="fab-util.html#get-finish">(<span class="funcname">get-finish</span>)</a></td>
<td>Returns the finish from the finish table or nil if no finish table found</td>
</tr>
<tr>
<td class="funcsig"><a href="fab-util.html#get-hardware">(<span class="funcname">get-hardware</span>)</a></td>
<td>Prompts the user to choose a hardware description via dialog and returns it</td>
</tr>
<tr>
<td class="funcsig"><a href="util-selection.html#get-ins-and-delete">(<span class="funcname">get-ins-and-delete</span> ename)</a></td>
<td>Deletes the entity named ENAME and returns its former insertion point</td>
@ -2086,6 +2146,13 @@
<tr>
<td class="funcsig"><a href="fab-util.html#get-material">(<span class="funcname">get-material</span>)</a></td>
<td>Prompts the user to choose a material description via dialog and returns it</td>
</tr>
<tr>
<td class="funcsig"><a href="util-selection.html#get-sset">(<span class="funcname">get-sset</span> app-ids-str)</a></td>
<td>Gets a selection from the user of objects with given XDATA app-ID</td>
@ -2121,6 +2188,15 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#get-table-cell">(<span class="funcname">get-table-cell</span>)</a></td>
<td>Prompts user for a point and checks if it is inside in a table</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-line.html#get-vlist">(<span class="funcname">get-vlist</span> pline)</a></td>
<td>Returns the list of vertices comprising PLINE in the form (x y bulge)</td>
@ -2150,8 +2226,8 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#gsl-mat-table-set-row">(<span class="funcname">gsl-mat-table-set-row</span> gsl-mat-table row data)</a></td>
<td>Sets a ROW in a generic ship loose template table</td>
<td class="funcsig"><a href="rail-util.html#guard-con-read">(<span class="funcname">guard-con-read</span> str)</a></td>
<td>Returns intiger from guard connection string by stripping X</td>
</tr>
@ -2184,13 +2260,6 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#hdw-table-set-row">(<span class="funcname">hdw-table-set-row</span> hdw-table row data)</a></td>
<td>Sets a ROW in HDW-TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="rail-rail-section.html#hr&bracket">(<span class="funcname">hr&bracket</span> con ins dir stl i/o)</a></td>
<td>create of hr and bracket for sr or wr</td>
@ -2233,6 +2302,13 @@
<tr>
<td class="funcsig"><a href="util-string.html#increment-mark">(<span class="funcname">increment-mark</span> mark)</a></td>
<td>Return the next string in spreadsheet column order</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-block.html#insert-block">(<span class="funcname">insert-block</span> container ins block)</a></td>
<td>Wrapper for vla-InsertBlock</td>
@ -2343,6 +2419,63 @@
<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>
<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>
<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 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 class="funcsig"><a href="land-land_supp.html#land-support-def">(<span class="funcname">land-support-def</span> corner view)</a></td>
<td>Returns a support definition based on corner and view</td>
@ -2533,61 +2666,76 @@
<tr>
<td class="funcsig"><a href="util-list.html#map-append">(<span class="funcname">map-append</span> f lst)</a></td>
<td>Alias for (apply 'append (mapcar f lst))</td>
<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="util-function.html#map-apply">(<span class="funcname">map-apply</span> f map)</a></td>
<td>Returns the results of applying F to each element of MAP</td>
<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="util-function.html#map-apply!">(<span class="funcname">map-apply!</span> f map-sym)</a></td>
<td>Updates the list at MAP-SYM in place using <a href="util-function.html#map-apply">map-apply</a></td>
<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="util-list.html#mapcar!">(<span class="funcname">mapcar!</span> f lst-sym)</a></td>
<td>Updates list at LST-SYM in place using mapcar</td>
<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="util-object-table.html#mat-table-add-data">(<span class="funcname">mat-table-add-data</span> before datas)</a></td>
<td>Adds bulk data to material table</td>
<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="util-object-table.html#mat-table-set-row">(<span class="funcname">mat-table-set-row</span> mat-table row data)</a></td>
<td>Sets a ROW in MAT-TABLE</td>
<td class="funcsig"><a href="util-list.html#map-append">(<span class="funcname">map-append</span> f lst)</a></td>
<td>Alias for (apply 'append (mapcar f lst))</td>
</tr>
<tr>
<td class="funcsig"><a href="util-function.html#map-apply">(<span class="funcname">map-apply</span> f map)</a></td>
<td>Returns the results of applying F to each element of MAP</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table-update-ea-wt">(<span class="funcname">mat-table-update-ea-wt</span> mat-table)</a></td>
<td>Updates the formula for "each weight" in MAT-TABLE to include any added rows</td>
<td class="funcsig"><a href="util-function.html#map-apply!">(<span class="funcname">map-apply!</span> f map-sym)</a></td>
<td>Updates the list at MAP-SYM in place using <a href="util-function.html#map-apply">map-apply</a></td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table-update-marks">(<span class="funcname">mat-table-update-marks</span> +- n at)</a></td>
<td>Update fab mark numbers in material table and callouts</td>
<td class="funcsig"><a href="util-list.html#mapcar!">(<span class="funcname">mapcar!</span> f lst-sym)</a></td>
<td>Updates list at LST-SYM in place using mapcar</td>
</tr>
<tr>
<td class="funcsig"><a href="stair-details.html#material-func">(<span class="funcname">material-func</span> num)</a></td>
<td>If a material function for detail NUM exists, calls it and returns its value</td>
@ -2595,6 +2743,13 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#material-table-p">(<span class="funcname">material-table-p</span> table)</a></td>
<td>Returns T if TABLE is a *Material table, i.e that its title <a href="util-string.html#ends-with">ends-with</a> "Material"</td>
</tr>
<tr>
<td class="funcsig"><a href="shapes-shape.html#mc-channel-pts">(<span class="funcname">mc-channel-pts</span> depth bf tw tf)</a></td>
<td>set correct slope for MC channels</td>
@ -2652,12 +2807,19 @@
<tr>
<td class="funcsig"><a href="embed-dialog.html#multi-embed-dialog">(<span class="funcname">multi-embed-dialog</span> dat)</a></td>
<td class="funcsig"><a href="embed-dialog.html#multi-embed-dialog">(<span class="funcname">multi-embed-dialog</span>)</a></td>
<td>Embed dialog functions for batch editing</td>
</tr>
<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="embed-dialog.html#multi-tog">(<span class="funcname">multi-tog</span> key val)</a></td>
<td>Toggle handling for multi edit dialog</td>
@ -2800,7 +2962,7 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#parse-table">(<span class="funcname">parse-table</span> table)</a></td>
<td>Returns the data in TABLE as a nested list of strings</td>
<td>Returns the data in TABLE as a list of data lists</td>
</tr>
@ -2819,6 +2981,13 @@
<tr>
<td class="funcsig"><a href="util-geometry.html#pipe-bend-lines-padded">(<span class="funcname">pipe-bend-lines-padded</span> segments-lst)</a></td>
<td>Wrapper for <a href="util-geometry.html#pipe-bend-lines">pipe-bend-lines</a> that always returns a 9-item list to match fab drawing tables</td>
</tr>
<tr>
<td class="funcsig"><a href="shapes-shape.html#pl-pts">(<span class="funcname">pl-pts</span> h w)</a></td>
<td>similar to add-rectangle here for consistent batch processing of connections @ 3d</td>
@ -3246,6 +3415,13 @@
<tr>
<td class="funcsig"><a href="fab-util.html#set-finish">(<span class="funcname">set-finish</span> value)</a></td>
<td>Sets the finish in the finish table to VALUE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-document.html#setup-env">(<span class="funcname">setup-env</span> 3d-p)</a></td>
<td>Ensure necessary layers, linetypes, and text styles are present</td>
@ -3295,6 +3471,13 @@
<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>
<tr>
<td class="funcsig"><a href="util-list.html#slice">(<span class="funcname">slice</span> lst start len)</a></td>
<td>Return a slice from LST of length LEN starting at START</td>
@ -3508,6 +3691,20 @@
<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>
<tr>
<td class="funcsig"><a href="stair-util.html#stair-slope">(<span class="funcname">stair-slope</span>)</a></td>
<td>Returns the nosing line in slope-intercept form.</td>
@ -3653,29 +3850,76 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#table-add-data">(<span class="funcname">table-add-data</span> table datas)</a></td>
<td>Adds bulk data to the end of TABLE with regeneration suppressed</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-divide-qty">(<span class="funcname">table-divide-qty</span> table qty-col n)</a></td>
<td class="funcsig"><a href="util-object-table.html#table-divide-qty">(<span class="funcname">table-divide-qty</span> table n)</a></td>
<td>Divides every quantity in TABLE by N</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-get-row">(<span class="funcname">table-get-row</span> table)</a></td>
<td>Prompts user for a point and checks if it is inside a row in TABLE</td>
<td class="funcsig"><a href="util-object-table.html#table-get-column-names">(<span class="funcname">table-get-column-names</span> table)</a></td>
<td>Returns the column names as a list of formatted strings</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-get-nrows">(<span class="funcname">table-get-nrows</span> table)</a></td>
<td>Returns the number of effective rows in TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-insert-rows">(<span class="funcname">table-insert-rows</span> table nrows before)</a></td>
<td>Inserts NROWS rows in a fab drawing TABLE before row BEFORE</td>
<td class="funcsig"><a href="util-object-table.html#table-get-title">(<span class="funcname">table-get-title</span> table)</a></td>
<td>Returns the contents of cell 0,0</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-multiply-qty">(<span class="funcname">table-multiply-qty</span> table qty-col n)</a></td>
<td class="funcsig"><a href="util-object-table.html#table-insert-rows">(<span class="funcname">table-insert-rows</span> table nrows after)</a></td>
<td>Inserts NROWS rows in a fab drawing TABLE after row AFTER</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-multiply-qty">(<span class="funcname">table-multiply-qty</span> table n)</a></td>
<td>Multiplies every quantity in TABLE by N</td>
</tr>
@ -3689,8 +3933,15 @@
<tr>
<td class="funcsig"><a href="util-object-table.html#table-row-extents">(<span class="funcname">table-row-extents</span> table row)</a></td>
<td>Returns the extents of a row in TABLE</td>
<td class="funcsig"><a href="util-object-table.html#table-set-row">(<span class="funcname">table-set-row</span> table row data)</a></td>
<td>Sets a ROW in TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-trim-empty-rows">(<span class="funcname">table-trim-empty-rows</span> table row)</a></td>
<td>Trims empty rows from TABLE, starting at ROW</td>
</tr>
@ -4031,6 +4282,13 @@
<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>
<tr>
<td class="funcsig"><a href="util-string.html#wcmatch-escape">(<span class="funcname">wcmatch-escape</span> str)</a></td>
<td>Escapes special characters in STR for use in wcmatch</td>

@ -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>

@ -19,6 +19,11 @@
<tbody>
<tr>
<td class="funcsig"><a href="rail-util.html#calc-stair-rail-opcl">(<span class="funcname">calc-stair-rail-opcl</span> side)</a></td>
<td>Returns the outer post centerline length of a stair rail</td>
</tr>
<tr>
<td class="funcsig"><a href="rail-util.html#g-fill">(<span class="funcname">g-fill</span> lst)</a></td>
<td>adds appropriate fill to rails created by topviewrails and dd-guard</td>
@ -30,8 +35,8 @@
</tr>
<tr>
<td class="funcsig"><a href="rail-util.html#gen-guard-btw-data">(<span class="funcname">gen-guard-btw-data</span>)</a></td>
<td>generates generic xdata for guard between stairs</td>
<td class="funcsig"><a href="rail-util.html#guard-con-read">(<span class="funcname">guard-con-read</span> str)</a></td>
<td>Returns intiger from guard connection string by stripping X</td>
</tr>
<tr>
@ -94,6 +99,13 @@
</table>
<section>
<h3 id="calc-stair-rail-opcl" class="funcsig">(<span class="funcname">calc-stair-rail-opcl</span> side)</h3>
<pre class="fulldoc">Returns the outer post centerline length of a stair rail
WITH-DATA</pre>
</section>
<section>
<h3 id="g-fill" class="funcsig">(<span class="funcname">g-fill</span> lst)</h3>
<pre class="fulldoc">adds appropriate fill to rails created by topviewrails and dd-guard</pre>
@ -105,10 +117,8 @@
</section>
<section>
<h3 id="gen-guard-btw-data" class="funcsig">(<span class="funcname">gen-guard-btw-data</span>)</h3>
<pre class="fulldoc">generates generic xdata for guard between stairs
WITH-DATA</pre>
<h3 id="guard-con-read" class="funcsig">(<span class="funcname">guard-con-read</span> str)</h3>
<pre class="fulldoc">Returns intiger from guard connection string by stripping X</pre>
</section>
<section>

@ -95,7 +95,7 @@
</tr>
<tr>
<td class="funcsig"><a href="stair-tread.html#calc-conc-lines--add-line-mid">(<span class="funcname">calc-conc-lines--add-line-mid</span> x1 x2-adj)</a></td>
<td class="funcsig"><a href="stair-tread.html#calc-conc-lines--add-line-mid">(<span class="funcname">calc-conc-lines--add-line-mid</span> x)</a></td>
<td>Adds a line to CONC-LINES</td>
</tr>
@ -350,14 +350,13 @@ WITH-DATA</pre>
</section>
<section>
<h3 id="calc-conc-lines--add-line-mid" class="funcsig">(<span class="funcname">calc-conc-lines--add-line-mid</span> x1 x2-adj)</h3>
<h3 id="calc-conc-lines--add-line-mid" class="funcsig">(<span class="funcname">calc-conc-lines--add-line-mid</span> x)</h3>
<pre class="fulldoc">Adds a line to CONC-LINES
x1 is relative to the nosing point. x2-adj is relative to x1+tread+kick
X is relative to the nosing point.
VARS:
(X1 REAL)
(X2-ADJ REAL)
(X REAL)
WITH-DATA</pre>
</section>

@ -221,7 +221,7 @@ flight, returns 0, indicating numbers are unnecessary.
WITH-DATA
VARS:
(LOC STR (MEMBER LOCATION '("ibot" "obot" "itop" "otop" "btwn")))</pre>
(LOC STR (MEMBER LOC '("ibot" "obot" "itop" "otop" "btwn")))</pre>
</section>

@ -129,6 +129,11 @@
<td>Returns the bend lines for a PSC pipe with segments SEGMENTS-LST</td>
</tr>
<tr>
<td class="funcsig"><a href="util-geometry.html#pipe-bend-lines-padded">(<span class="funcname">pipe-bend-lines-padded</span> segments-lst)</a></td>
<td>Wrapper for <a href="util-geometry.html#pipe-bend-lines">pipe-bend-lines</a> that always returns a 9-item list to match fab drawing tables</td>
</tr>
<tr>
<td class="funcsig"><a href="util-geometry.html#point-p">(<span class="funcname">point-p</span> pt)</a></td>
<td>Returns T if PT is a 2- or 3-item list of numbers</td>
@ -366,6 +371,11 @@ Each element to SEGMENTS-LST should be a string. Assumes 1.66OD pipe, centerline
2.83" and k value of 0.18.</pre>
</section>
<section>
<h3 id="pipe-bend-lines-padded" class="funcsig">(<span class="funcname">pipe-bend-lines-padded</span> segments-lst)</h3>
<pre class="fulldoc">Wrapper for <a href="util-geometry.html#pipe-bend-lines">pipe-bend-lines</a> that always returns a 9-item list to match fab drawing tables</pre>
</section>
<section>
<h3 id="point-p" class="funcsig">(<span class="funcname">point-p</span> pt)</h3>
<pre class="fulldoc">Returns T if PT is a 2- or 3-item list of numbers</pre>

@ -22,64 +22,66 @@ operations.</pre>
</thead>
<tbody>
<tr><td colspan="3">Public</td></tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#get-table-by-title">(<span class="funcname">get-table-by-title</span> title)</a></td>
<td>Returns the table with matching TITLE</td>
<td class="funcsig"><a href="util-object-table.html#get-all-tables">(<span class="funcname">get-all-tables</span>)</a></td>
<td>Returns a list of all tables</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#gsl-mat-table-set-row">(<span class="funcname">gsl-mat-table-set-row</span> gsl-mat-table row data)</a></td>
<td>Sets a ROW in a generic ship loose template table</td>
<td class="funcsig"><a href="util-object-table.html#get-table-by-title">(<span class="funcname">get-table-by-title</span> title)</a></td>
<td>Returns the table with matching TITLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#hdw-table-set-row">(<span class="funcname">hdw-table-set-row</span> hdw-table row data)</a></td>
<td>Sets a ROW in HDW-TABLE</td>
<td class="funcsig"><a href="util-object-table.html#get-table-cell">(<span class="funcname">get-table-cell</span>)</a></td>
<td>Prompts user for a point and checks if it is inside in a table</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table-add-data">(<span class="funcname">mat-table-add-data</span> before datas)</a></td>
<td>Adds bulk data to material table</td>
<td class="funcsig"><a href="util-object-table.html#material-table-p">(<span class="funcname">material-table-p</span> table)</a></td>
<td>Returns T if TABLE is a *Material table, i.e that its title <a href="util-string.html#ends-with">ends-with</a> "Material"</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table-set-row">(<span class="funcname">mat-table-set-row</span> mat-table row data)</a></td>
<td>Sets a ROW in MAT-TABLE</td>
<td class="funcsig"><a href="util-object-table.html#parse-table">(<span class="funcname">parse-table</span> table)</a></td>
<td>Returns the data in TABLE as a list of data lists</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table-update-ea-wt">(<span class="funcname">mat-table-update-ea-wt</span> mat-table)</a></td>
<td>Updates the formula for "each weight" in MAT-TABLE to include any added rows</td>
<td class="funcsig"><a href="util-object-table.html#table-add-data">(<span class="funcname">table-add-data</span> table datas)</a></td>
<td>Adds bulk data to the end of TABLE with regeneration suppressed</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table-update-marks">(<span class="funcname">mat-table-update-marks</span> +- n at)</a></td>
<td>Update fab mark numbers in material table and callouts</td>
<td class="funcsig"><a href="util-object-table.html#table-divide-qty">(<span class="funcname">table-divide-qty</span> table n)</a></td>
<td>Divides every quantity in TABLE by N</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#parse-table">(<span class="funcname">parse-table</span> table)</a></td>
<td>Returns the data in TABLE as a nested list of strings</td>
<td class="funcsig"><a href="util-object-table.html#table-get-column-names">(<span class="funcname">table-get-column-names</span> table)</a></td>
<td>Returns the column names as a list of formatted strings</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-divide-qty">(<span class="funcname">table-divide-qty</span> table qty-col n)</a></td>
<td>Divides every quantity in TABLE by N</td>
<td class="funcsig"><a href="util-object-table.html#table-get-nrows">(<span class="funcname">table-get-nrows</span> table)</a></td>
<td>Returns the number of effective rows in TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-get-row">(<span class="funcname">table-get-row</span> table)</a></td>
<td>Prompts user for a point and checks if it is inside a row in TABLE</td>
<td class="funcsig"><a href="util-object-table.html#table-get-title">(<span class="funcname">table-get-title</span> table)</a></td>
<td>Returns the contents of cell 0,0</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-insert-rows">(<span class="funcname">table-insert-rows</span> table nrows before)</a></td>
<td>Inserts NROWS rows in a fab drawing TABLE before row BEFORE</td>
<td class="funcsig"><a href="util-object-table.html#table-insert-rows">(<span class="funcname">table-insert-rows</span> table nrows after)</a></td>
<td>Inserts NROWS rows in a fab drawing TABLE after row AFTER</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-multiply-qty">(<span class="funcname">table-multiply-qty</span> table qty-col n)</a></td>
<td class="funcsig"><a href="util-object-table.html#table-multiply-qty">(<span class="funcname">table-multiply-qty</span> table n)</a></td>
<td>Multiplies every quantity in TABLE by N</td>
</tr>
@ -89,15 +91,128 @@ operations.</pre>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-row-extents">(<span class="funcname">table-row-extents</span> table row)</a></td>
<td>Returns the extents of a row in TABLE</td>
<td class="funcsig"><a href="util-object-table.html#table-set-row">(<span class="funcname">table-set-row</span> table row data)</a></td>
<td>Sets a ROW in TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table-trim-empty-rows">(<span class="funcname">table-trim-empty-rows</span> table row)</a></td>
<td>Trims empty rows from TABLE, starting at ROW</td>
</tr>
<tr><td colspan="3">Private</td></tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#--shift-tables">(<span class="funcname">--shift-tables</span> names delta-y)</a></td>
<td>Move the tables named in NAMES vertically by DELTA-Y</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#--shift-tables-maybe">(<span class="funcname">--shift-tables-maybe</span> title delta-y)</a></td>
<td>If TITLE is one of the generic fab tables, call <a href="util-object-table.html#--shift-tables">--shift-tables</a></td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#get-table-cell--bounding-box">(<span class="funcname">get-table-cell--bounding-box</span> table row col)</a></td>
<td>Returns the bounding box for the cell as a list of the form (minpt maxpt)</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table--calc-weight-formula">(<span class="funcname">mat-table--calc-weight-formula</span> table row)</a></td>
<td>Returns the weight formula for a material description</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table--fix-summary-row">(<span class="funcname">mat-table--fix-summary-row</span> table)</a></td>
<td>Change the last row to be a simple sum of weight column if necessary</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table--update-marks">(<span class="funcname">mat-table--update-marks</span> table +- n row)</a></td>
<td>Update fab mark numbers in TABLE and callouts</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#mat-table--update-total-weight">(<span class="funcname">mat-table--update-total-weight</span> table)</a></td>
<td>Updates the formula for each weight in TABLE to include any added rows</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--abbr-desc-column">(<span class="funcname">table--abbr-desc-column</span> table)</a></td>
<td>If there is a "Description" column in TABLE, rewrites it as "Desc"</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--body-rows">(<span class="funcname">table--body-rows</span> table)</a></td>
<td>Returns a list of body (not title or header) row indices in TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--cells">(<span class="funcname">table--cells</span> table)</a></td>
<td>Returns a list of cells in TABLE as 2-item lists of the form (row col)</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--column-name->letter">(<span class="funcname">table--column-name-&gt;letter</span> name)</a></td>
<td>Returns the letter designation of the column named NAME</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--decimal-format-cell">(<span class="funcname">table--decimal-format-cell</span> table row col)</a></td>
<td>Wrapper for vla-SetCellFormat</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--empty-first-column-p">(<span class="funcname">table--empty-first-column-p</span> table row)</a></td>
<td>Returns T if column 0 of ROW is empty</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--fix">(<span class="funcname">table--fix</span> table)</a></td>
<td>Performs all necessary fixes on TABLE</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--fix-row-height">(<span class="funcname">table--fix-row-height</span> table row orig-ht)</a></td>
<td>Constrains the row height to multiples of table base row height</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--format-column-name">(<span class="funcname">table--format-column-name</span> name)</a></td>
<td>Returns NAME as lowercase with spaces replaced by underscores</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--get-column-names-maybe">(<span class="funcname">table--get-column-names-maybe</span> table)</a></td>
<td>If the symbol 'col-names is defined, returns its value. Otherwise, calls <a href="util-object-table.html#table-get-column-names">table-get-column-names</a></td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--get-header-row">(<span class="funcname">table--get-header-row</span> table)</a></td>
<td>Returns the index of the row containing the column headers</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--get-title-maybe">(<span class="funcname">table--get-title-maybe</span> table)</a></td>
<td>If the symbol TITLE is defined, returns its value. Otherwise, calls <a href="util-object-table.html#table-get-title">table-get-title</a></td>
</tr>
<tr>
<td class="funcsig"><a href="util-object-table.html#table--pt-in-table-p">(<span class="funcname">table--pt-in-table-p</span> pt table)</a></td>
<td>Returns T if PT is within TABLE's bounding box</td>
</tr>
</tbody>
</table>
<section>
<h3 id="get-all-tables" class="funcsig">(<span class="funcname">get-all-tables</span>)</h3>
<pre class="fulldoc">Returns a list of all tables</pre>
</section>
<section>
<h3 id="get-table-by-title" class="funcsig">(<span class="funcname">get-table-by-title</span> title)</h3>
<pre class="fulldoc">Returns the table with matching TITLE
@ -105,154 +220,330 @@ operations.</pre>
TITLE is matched against cell A1 of all tables in the database using wcmatch, so any
wildcards wcmatch accepts will work here.
Automatically calls <a href="util-object-table.html#table--fix">table--fix</a>
VARS:
(TITLE STR)</pre>
</section>
<section>
<h3 id="gsl-mat-table-set-row" class="funcsig">(<span class="funcname">gsl-mat-table-set-row</span> gsl-mat-table row data)</h3>
<pre class="fulldoc">Sets a ROW in a generic ship loose template table
<h3 id="get-table-cell" class="funcsig">(<span class="funcname">get-table-cell</span>)</h3>
<pre class="fulldoc">Prompts user for a point and checks if it is inside in a table
ROW is a row index and DATA is a data list whose keys correspond to the table columns.
If so, it returns a list of the form (table row column).</pre>
</section>
<section>
<h3 id="material-table-p" class="funcsig">(<span class="funcname">material-table-p</span> table)</h3>
<pre class="fulldoc">Returns T if TABLE is a *Material table, i.e that its title <a href="util-string.html#ends-with">ends-with</a> "Material"
VARS:
(GSL-MAT-TABLE VLA-OBJECT (TABLE-P GSL-MAT-TABLE))
(ROW INT (>= ROW 0))
(DATA nil (DATA-LIST-P DATA))</pre>
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="hdw-table-set-row" class="funcsig">(<span class="funcname">hdw-table-set-row</span> hdw-table row data)</h3>
<pre class="fulldoc">Sets a ROW in HDW-TABLE
<h3 id="parse-table" class="funcsig">(<span class="funcname">parse-table</span> table)</h3>
<pre class="fulldoc">Returns the data in TABLE as a list of data lists
ROW is a row index and DATA is a data list whose keys correspond to the table columns.
Each list item corresponse to a row. The keys of the datalists correspond to the column
names. The names are converted to lowercase and spaces are replaced with underscores to
form the key names.
Rows whose first column is blank are not considered. The first row is the title row, with
the table title at 0,0. The second row is considered the header row and column names come
from this row.
VARS:
(HDW-TABLE VLA-OBJECT (TABLE-P HDW-TABLE))
(ROW INT (>= ROW 0))
(DATA nil (DATA-LIST-P DATA))</pre>
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="mat-table-add-data" class="funcsig">(<span class="funcname">mat-table-add-data</span> before datas)</h3>
<pre class="fulldoc">Adds bulk data to material table
<h3 id="table-add-data" class="funcsig">(<span class="funcname">table-add-data</span> table datas)</h3>
<pre class="fulldoc">Adds bulk data to the end of TABLE with regeneration suppressed
BEFORE is the row to add data at. The special symbol 'end means the last row. DATAS is a
list of data lists representing row data.
DATAS is a list of data lists representing row data.
VARS:
(BEFORE nil (OR (= BEFORE 'END) (= (TYPE BEFORE) 'INT)))
(TABLE VLA-OBJECT (TABLE-P TABLE))
(DATAS LIST (VL-EVERY 'DATA-LIST-P DATAS))</pre>
</section>
<section>
<h3 id="mat-table-set-row" class="funcsig">(<span class="funcname">mat-table-set-row</span> mat-table row data)</h3>
<pre class="fulldoc">Sets a ROW in MAT-TABLE
<h3 id="table-divide-qty" class="funcsig">(<span class="funcname">table-divide-qty</span> table n)</h3>
<pre class="fulldoc">Divides every quantity in TABLE by N
ROW is a row index and DATA is a data list whose keys correspond to the table columns.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(N INT)</pre>
</section>
<section>
<h3 id="table-get-column-names" class="funcsig">(<span class="funcname">table-get-column-names</span> table)</h3>
<pre class="fulldoc">Returns the column names as a list of formatted strings
Strings are formatted by <a href="util-object-table.html#table--format-column-name">table--format-column-name</a>
VARS:
(MAT-TABLE VLA-OBJECT (TABLE-P MAT-TABLE))
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-get-nrows" class="funcsig">(<span class="funcname">table-get-nrows</span> table)</h3>
<pre class="fulldoc">Returns the number of effective rows in TABLE
Effective rows includes the title, header, and body rows except for the weight summary row
in *Material tables.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-get-title" class="funcsig">(<span class="funcname">table-get-title</span> table)</h3>
<pre class="fulldoc">Returns the contents of cell 0,0
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-insert-rows" class="funcsig">(<span class="funcname">table-insert-rows</span> table nrows after)</h3>
<pre class="fulldoc">Inserts NROWS rows in a fab drawing TABLE after row AFTER
If this is a generic fab table there are other generic fab tables below this one, move
them down to accomodate. If this is the Assembly* table, update the quantities in Material
and Hardware tables, if found.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(NROWS INT)
(AFTER INT)</pre>
</section>
<section>
<h3 id="table-multiply-qty" class="funcsig">(<span class="funcname">table-multiply-qty</span> table n)</h3>
<pre class="fulldoc">Multiplies every quantity in TABLE by N
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(N INT)</pre>
</section>
<section>
<h3 id="table-p" class="funcsig">(<span class="funcname">table-p</span> obj)</h3>
<pre class="fulldoc">Returns T if OBJ is a table
VARS:
(OBJ VLA-OBJECT)</pre>
</section>
<section>
<h3 id="table-set-row" class="funcsig">(<span class="funcname">table-set-row</span> table row data)</h3>
<pre class="fulldoc">Sets a ROW in TABLE
ROW is a row index and DATA is a data list whose keys correspond to the table columns. If TABLE is a material table, attempts to set the weight formula.
To add data in bulk with formula regeneration disabled to improve performance, see
<a href="util-object-table.html#table-add-data">table-add-data</a>
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(ROW INT (>= ROW 0))
(DATA nil (DATA-LIST-P DATA))</pre>
</section>
<section>
<h3 id="mat-table-update-ea-wt" class="funcsig">(<span class="funcname">mat-table-update-ea-wt</span> mat-table)</h3>
<pre class="fulldoc">Updates the formula for "each weight" in MAT-TABLE to include any added rows
<h3 id="table-trim-empty-rows" class="funcsig">(<span class="funcname">table-trim-empty-rows</span> table row)</h3>
<pre class="fulldoc">Trims empty rows from TABLE, starting at ROW
Determines if row is empty using <a href="util-object-table.html#table--empty-first-column-p">table--empty-first-column-p</a>
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(ROW INT)</pre>
</section>
<section>
<h3 id="--shift-tables" class="funcsig">(<span class="funcname">--shift-tables</span> names delta-y)</h3>
<pre class="fulldoc">Move the tables named in NAMES vertically by DELTA-Y
VARS:
(NAMES (LIST nil) (VL-EVERY 'STRINGP NAMES))
(DELTA-Y nil (NUMBERP DELTA-Y))</pre>
</section>
<section>
<h3 id="--shift-tables-maybe" class="funcsig">(<span class="funcname">--shift-tables-maybe</span> title delta-y)</h3>
<pre class="fulldoc">If TITLE is one of the generic fab tables, call <a href="util-object-table.html#--shift-tables">--shift-tables</a></pre>
</section>
<section>
<h3 id="get-table-cell--bounding-box" class="funcsig">(<span class="funcname">get-table-cell--bounding-box</span> table row col)</h3>
<pre class="fulldoc">Returns the bounding box for the cell as a list of the form (minpt maxpt)
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(ROW INT)
(COL INT)</pre>
</section>
<section>
<h3 id="mat-table--calc-weight-formula" class="funcsig">(<span class="funcname">mat-table--calc-weight-formula</span> table row)</h3>
<pre class="fulldoc">Returns the weight formula for a material description
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(ROW INT)</pre>
</section>
<section>
<h3 id="mat-table--fix-summary-row" class="funcsig">(<span class="funcname">mat-table--fix-summary-row</span> table)</h3>
<pre class="fulldoc">Change the last row to be a simple sum of weight column if necessary
VARS:
(MAT-TABLE VLA-OBJECT (TABLE-P MAT-TABLE))</pre>
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="mat-table-update-marks" class="funcsig">(<span class="funcname">mat-table-update-marks</span> +- n at)</h3>
<pre class="fulldoc">Update fab mark numbers in material table and callouts
<h3 id="mat-table--update-marks" class="funcsig">(<span class="funcname">mat-table--update-marks</span> table +- n row)</h3>
<pre class="fulldoc">Update fab mark numbers in TABLE and callouts
+- should be one of the built-in functions + or -, indicating whether the mark numbers
should increase or decrease. N is the number of places the number should jump. AT is the
should increase or decrease. N is the number of places the number should jump. ROW is the
first row in the material table containing mark numbers to change.
Expects to be called by a function with TABLE set to the material table.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(+- SUBR (MEMBER +- (LIST + -)))
(N INT)
(AT INT)
(ROW INT)</pre>
</section>
<section>
<h3 id="mat-table--update-total-weight" class="funcsig">(<span class="funcname">mat-table--update-total-weight</span> table)</h3>
<pre class="fulldoc">Updates the formula for each weight in TABLE to include any added rows
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE) (MATERIAL-TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table--abbr-desc-column" class="funcsig">(<span class="funcname">table--abbr-desc-column</span> table)</h3>
<pre class="fulldoc">If there is a "Description" column in TABLE, rewrites it as "Desc"
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="parse-table" class="funcsig">(<span class="funcname">parse-table</span> table)</h3>
<pre class="fulldoc">Returns the data in TABLE as a nested list of strings
<h3 id="table--body-rows" class="funcsig">(<span class="funcname">table--body-rows</span> table)</h3>
<pre class="fulldoc">Returns a list of body (not title or header) row indices in TABLE
Skips the first two rows (assumes they are headers) and any rows whose first column is
blank.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table--cells" class="funcsig">(<span class="funcname">table--cells</span> table)</h3>
<pre class="fulldoc">Returns a list of cells in TABLE as 2-item lists of the form (row col)
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-divide-qty" class="funcsig">(<span class="funcname">table-divide-qty</span> table qty-col n)</h3>
<pre class="fulldoc">Divides every quantity in TABLE by N
<h3 id="table--column-name->letter" class="funcsig">(<span class="funcname">table--column-name-&gt;letter</span> name)</h3>
<pre class="fulldoc">Returns the letter designation of the column named NAME
QTY-COL is the index of the quantities column.
Either 'col-names or 'table must be defined.
VARS:
(NAME STR)</pre>
</section>
<section>
<h3 id="table--decimal-format-cell" class="funcsig">(<span class="funcname">table--decimal-format-cell</span> table row col)</h3>
<pre class="fulldoc">Wrapper for vla-SetCellFormat
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(QTY-COL INT (>= QTY-COL 0))
(N INT)</pre>
(ROW INT)
(COL INT)</pre>
</section>
<section>
<h3 id="table--empty-first-column-p" class="funcsig">(<span class="funcname">table--empty-first-column-p</span> table row)</h3>
<pre class="fulldoc">Returns T if column 0 of ROW is empty
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(ROW INT)</pre>
</section>
<section>
<h3 id="table-get-row" class="funcsig">(<span class="funcname">table-get-row</span> table)</h3>
<pre class="fulldoc">Prompts user for a point and checks if it is inside a row in TABLE
<h3 id="table--fix" class="funcsig">(<span class="funcname">table--fix</span> table)</h3>
<pre class="fulldoc">Performs all necessary fixes on TABLE
Currently:
<a href="util-object-table.html#table--abbr-desc-column">table--abbr-desc-column</a>
<a href="util-object-table.html#mat-table--fix-summary-row">mat-table--fix-summary-row</a> (material tables only)
If so, it returns the index of that row.
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-insert-rows" class="funcsig">(<span class="funcname">table-insert-rows</span> table nrows before)</h3>
<pre class="fulldoc">Inserts NROWS rows in a fab drawing TABLE before row BEFORE
<h3 id="table--fix-row-height" class="funcsig">(<span class="funcname">table--fix-row-height</span> table row orig-ht)</h3>
<pre class="fulldoc">Constrains the row height to multiples of table base row height
If there are other fab tables below this one, move them down to accomodate.
If ROW height has changed from ORIG-HT, calls <a href="util-object-table.html#--shift-tables-maybe">--shift-tables-maybe</a>
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(NROWS INT)
(BEFORE INT)</pre>
(ROW INT)
(ORIG-HT REAL)</pre>
</section>
<section>
<h3 id="table-multiply-qty" class="funcsig">(<span class="funcname">table-multiply-qty</span> table qty-col n)</h3>
<pre class="fulldoc">Multiplies every quantity in TABLE by N
<h3 id="table--format-column-name" class="funcsig">(<span class="funcname">table--format-column-name</span> name)</h3>
<pre class="fulldoc">Returns NAME as lowercase with spaces replaced by underscores
QTY-COL is the index of the quantities column.
VARS:
(NAME STR)</pre>
</section>
<section>
<h3 id="table--get-column-names-maybe" class="funcsig">(<span class="funcname">table--get-column-names-maybe</span> table)</h3>
<pre class="fulldoc">If the symbol 'col-names is defined, returns its value. Otherwise, calls <a href="util-object-table.html#table-get-column-names">table-get-column-names</a>
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(QTY-COL INT (>= QTY-COL 0))
(N INT)</pre>
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-p" class="funcsig">(<span class="funcname">table-p</span> obj)</h3>
<pre class="fulldoc">Returns T if OBJ is a table</pre>
<h3 id="table--get-header-row" class="funcsig">(<span class="funcname">table--get-header-row</span> table)</h3>
<pre class="fulldoc">Returns the index of the row containing the column headers
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table-row-extents" class="funcsig">(<span class="funcname">table-row-extents</span> table row)</h3>
<pre class="fulldoc">Returns the extents of a row in TABLE
<h3 id="table--get-title-maybe" class="funcsig">(<span class="funcname">table--get-title-maybe</span> table)</h3>
<pre class="fulldoc">If the symbol TITLE is defined, returns its value. Otherwise, calls <a href="util-object-table.html#table-get-title">table-get-title</a>
The return value is a 2-item list in the form '(top-left-pt bot-right-pt).
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>
<section>
<h3 id="table--pt-in-table-p" class="funcsig">(<span class="funcname">table--pt-in-table-p</span> pt table)</h3>
<pre class="fulldoc">Returns T if PT is within TABLE's bounding box
VARS:
(TABLE VLA-OBJECT (TABLE-P TABLE))
(ROW INT)</pre>
(PT LIST (POINT-P PT))
(TABLE VLA-OBJECT (TABLE-P TABLE))</pre>
</section>

@ -34,6 +34,11 @@
<td>Adds a calculated polyline to CONTAINER</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object.html#add-cope">(<span class="funcname">add-cope</span> vtx vec)</a></td>
<td>Called from <a href="util-object.html#add-calcd-pipe">add-calcd-pipe</a> when a cope definition is included in the points list.</td>
</tr>
<tr>
<td class="funcsig"><a href="util-object.html#mirror&delete">(<span class="funcname">mirror&delete</span> obj pt axis)</a></td>
<td>Mirrors OBJ over AXIS at PT, deletes the original, and returns the copy</td>
@ -103,6 +108,20 @@ polyline. If EXTRUDE-P is non-nil, the closed polyline is extruded by the value
"extrude" property.</pre>
</section>
<section>
<h3 id="add-cope" class="funcsig">(<span class="funcname">add-cope</span> vtx vec)</h3>
<pre class="fulldoc">Called from <a href="util-object.html#add-calcd-pipe">add-calcd-pipe</a> when a cope definition is included in the points list.
A cope definition is a two item list containing a point on the open polyline where
the centerlines of a coped connection would intersect and a vector representing the
direction the coped piece would extend from the intersection point.
When extrude-p is non-nil a short 3d cylinder is unioned to
the 3dsolid at each passed point representing a coped intersection
When extrude-p is nil two vertices and a bulge are added to
a polyline at each passed point representing a coped intersection</pre>
</section>
<section>
<h3 id="mirror&delete" class="funcsig">(<span class="funcname">mirror&delete</span> obj pt axis)</h3>
<pre class="fulldoc">Mirrors OBJ over AXIS at PT, deletes the original, and returns the copy

@ -49,6 +49,11 @@
<td>Returns the first line of STR</td>
</tr>
<tr>
<td class="funcsig"><a href="util-string.html#increment-mark">(<span class="funcname">increment-mark</span> mark)</a></td>
<td>Return the next string in spreadsheet column order</td>
</tr>
<tr>
<td class="funcsig"><a href="util-string.html#lowercase">(<span class="funcname">lowercase</span> str)</a></td>
<td>Returns STR in lowercase</td>
@ -164,6 +169,19 @@ TESTS:
item2") "item1")</pre>
</section>
<section>
<h3 id="increment-mark" class="funcsig">(<span class="funcname">increment-mark</span> mark)</h3>
<pre class="fulldoc">Return the next string in spreadsheet column order
VARS:
(MARK STR)
TESTS:
(= (INCREMENT-MARK "A") "B")
(= (INCREMENT-MARK "Z") "AA")
(= (INCREMENT-MARK "ZZ") "AAA")</pre>
</section>
<section>
<h3 id="lowercase" class="funcsig">(<span class="funcname">lowercase</span> str)</h3>
<pre class="fulldoc">Returns STR in lowercase

@ -150,7 +150,7 @@
Similarity is determined by equality on the values of keys listed in KEYS. PRIMARY-KEY, if
provided, is the unique ID key for a list. The values of this key are preserved in the
final grouping. If a key named 'qty' is present in KEYS, it will be preserved and
final grouping. If a key named 'qty' is present in DATALSTS, it will be preserved and
incremented to reflect grouping.</pre>
</section>

@ -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

@ -5,7 +5,7 @@
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1><a href="user-manual.html">User Manual</a> - List of Commands (57)</h1>
<h1><a href="user-manual.html">User Manual</a> - List of Commands (54)</h1>
<div id="content">
<p>Commands with more than one line of documentation have the
full version included below.</p>
@ -36,11 +36,6 @@
<td>Generates rail return blocks from stair block selection</td>
</tr>
<tr>
<td>BUGREPORT</td>
<td>Opens a bug report email template in Outlook</td>
</tr>
<tr>
<td>CODEMANUAL</td>
<td>Opens the code manual in the default browser</td>
@ -48,7 +43,7 @@
<tr>
<td>DD-GUARD</td>
<td>Creates or edits a guard rail block</td>
<td>Creates or edits one or more guard rail blocks</td>
</tr>
<tr>
@ -97,13 +92,8 @@
</tr>
<tr>
<td><a href="#EDITHARDWARE">EDITHARDWARE</a></td>
<td>Edits a hardware table entry in a fab drawing</td>
</tr>
<tr>
<td><a href="#EDITMATERIAL">EDITMATERIAL</a></td>
<td>Edits a material table entry in a fab drawing</td>
<td><a href="#EDITTABLE">EDITTABLE</a></td>
<td>Edits the description of an item in a material or hardware table.</td>
</tr>
<tr>
@ -136,11 +126,6 @@
<td>Creates a new drawing in the current folder from a built-in template</td>
</tr>
<tr>
<td>FEATUREREQ</td>
<td>Opens a feature request email template in Outlook</td>
</tr>
<tr>
<td><a href="#GUARDRAIL">GUARDRAIL</a></td>
<td>Draws a basic 2D guardrail frame</td>
@ -390,20 +375,10 @@ double-clicking.</pre>
</section>
<section>
<h3 id="EDITHARDWARE">EDITHARDWARE</h3>
<pre class="fulldoc">Edits a hardware table entry in a fab drawing
<h3 id="EDITTABLE">EDITTABLE</h3>
<pre class="fulldoc">Edits the description of an item in a material or hardware table.
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.</pre>
</section>
<section>
<h3 id="EDITMATERIAL">EDITMATERIAL</h3>
<pre class="fulldoc">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.</pre>
In a material table, this command also updates the item weight.</pre>
</section>
<section>
@ -447,7 +422,6 @@ already built in to the template.</pre>
<section>
<h3 id="GUARDRAIL">GUARDRAIL</h3>
<pre class="fulldoc">Draws a basic 2D guardrail frame
This is a placeholder command</pre>
</section>
@ -455,12 +429,12 @@ This is a placeholder command</pre>
<h3 id="INSERTROWS">INSERTROWS</h3>
<pre class="fulldoc">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.</pre>
@ -585,14 +559,11 @@ their tags.</pre>
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.</pre>
</section>

File diff suppressed because one or more lines are too long

Binary file not shown.

@ -5,21 +5,21 @@
(defun-q make-closure-plate-fabs (stairs / plates plate-map)
"Creates all the closure plate fab drawings for this group of STAIRS"
(declare (vars (stairs list (vl-every 'data-list-p stairs))))
(setq plates (strip-nil (apply-by-twos 'calc-closure-plate stairs)))
(foreach plate plates
(foreach plate (strip-nil (apply-by-twos 'calc-closure-plate stairs))
(add-to-alist 'plate-map (car plate) (list (cdr plate)) T))
(foreach plates plate-map
((lambda(/ finish)
(setq finish (pop! 'plates))
(while plates
(make-closure-plate-fab finish (take! 69420 'plates)))))))
(make-closure-plate-fab finish (take! 85 'plates)))))))
(defun-r 'make-closure-plate-fabs)
(defun-q calc-closure-plate (s1 s2 / calc)
"Returns the closure plate definition for the plate between stairs S1 and S2
The format is a list of strings matching the table in the template."
(defun calc (s1 s2 / s1-hgt s2-hgt diff)
The return value will be a list whose car is the finish string and cdr is a datalist for
the table."
(defun calc (s1 s2 / s1-hgt s2-hgt diff ret)
(setq s1-hgt (xd-value "i-nosing_top" s1)
s2-hgt (if (wcmatch (xd-value "bot_conn" s2) "*haunch*")
(xd-value "i-nosing_bot" s2)
@ -29,43 +29,49 @@ The format is a list of strings matching the table in the template."
rise_hgt)
i-nosing_mid)
0))))
wid (frac (xd-value "dist_btwn" s1))
diff (- s2-hgt s1-hgt))
(append
(with-data s1 '((list finish "CP" number level sequence)))
(if (< diff 0.5)
(list "1" wid "")
(list "2" wid (frac (- 12 diff))))))
diff (- s2-hgt s1-hgt)
ret (with-data s1
'((#! '(("piece_type" "CP")
("stair_number" #number)
("level" #level)
("sequence" #sequence)
("qty" 1)
("desc" "PLATE 1/4")
("length" #(frac (xd-value "dist_btwn" s1)))
("note" "SL"))))))
(append (list (xd-value "finish" s1))
ret
(if (< diff 0.5)
'(("width" "6"))
(#! '(("width" "12")
("detail" "P1")
("cut_height" #(frac (- 12 diff))))))))
(if (> (xd-value "dist_btwn" s1) 0) (calc s1 s2)))
(defun-r 'calc-closure-plate)
(defun-q make-closure-plate-fab (finish plates / dwgno path login)
(defun-q make-closure-plate-fab (finish plates / dwgno path login prefix)
"Creates a single closure plate fab drawing"
(declare (vars (finish str)
(plates list (vl-every 'list-of-strings-p plates))))
(setq dwgno (land-fab-calc-sl-dwg-no jobno stairno))
(debug-print '("Making closure plate fab dwg: " #dwgno))
(plates list (vl-every 'data-list-p plates))))
(setq path (vla-get-Path acadDoc)
login (getvar 'loginname)
dwgno (land-sl--calc-dwg-no jobno stairno)
prefix (next-mark-prefix)
acadDoc (vla-Add (vla-get-Documents acadObj)
(strcat psc-src-dir "fab/closure-plate.dwt"))
modelspace (vla-get-ModelSpace acadDoc))
(write-title-block job-info stairno login "CLOSURE PLATES")
;; write finish table
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
(set-finish finish)
;; write main table
((lambda(/ tbl row col)
(setq tbl (get-table-by-title "Closure Plates")
row 2)
(table-insert-rows tbl (length plates) 3)
(vla-put-RegenerateTableSuppressed tbl :vlax-true)
(foreach p plates
(setq col -1)
(inc! 'row)
(foreach c p (vla-SetText tbl row (inc! 'col) c)))
(vla-put-RegenerateTableSuppressed tbl :vlax-false)))
(table-add-data (get-table-by-title "Misc Material")
((lambda(/ i)
(setq i 0)
(mapcar '(lambda(plate)
(add-to-list 'plate
(list "mark" (strcat prefix (to-string (inc! 'i))))))
plates))))
(vla-Regen acadDoc acAllViewports)
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
(if (not *dev-mode*) (vla-Close acadDoc))

@ -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.

@ -13,7 +13,7 @@
(defun-q make-handrail-return-fab (finish returns)
"Uses %make-rail-fab-common to create a handrail return spreadsheet"
(declare (vars (finish str)
(returns list (vl-every 'list-of-strings-p returns))))
(returns list (vl-every 'data-list-p returns))))
(debug-print '("Making handrail return fab"))
(make-rail-fab-common "handrail-return" '(handrail-return-write-table finish returns)))
(defun-r 'make-handrail-return-fab)
@ -21,19 +21,9 @@
(defun-q handrail-return-write-table (finish returns / table)
"Function used by %make-rail-fab-common to write the main table"
(declare (vars (finish str)
(returns list (vl-every 'list-of-strings-p returns))))
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
(setq table (get-table-by-title "Handrail Returns")
row 1)
(vla-put-RegenerateTableSuppressed table :vlax-true)
(table-insert-rows table (length returns) 2)
(foreach rail returns
(setq col -1)
(inc! 'row)
(foreach x rail
(vla-SetText table row (inc! 'col) (to-string x))))
(vla-put-RegenerateTableSuppressed table :vlax-false))
(returns list (vl-every 'data-list-p returns))))
(set-finish finish)
(table-add-data (get-table-by-title "Handrail Returns") returns))
(defun-r 'handrail-return-write-table)
(defun-q calc-handrail-return-fabs (stairs)
@ -43,13 +33,11 @@
(apply-by-twos 'calc-handrail-return-fab stairs)))
(defun-r 'calc-handrail-return-fabs)
(defun-q combine-handrail-return-fabs (returns / key keys return-map)
(defun-q combine-handrail-return-fabs (returns / key return-map)
"Combines RETURNS with equal finishes into a map"
(declare (vars (returns list)))
(foreach return (remove returns '(null x))
(foreach return (strip-nil returns)
(setq key (pop! 'return))
(if (not (member key keys))
(add-to-list 'keys key))
(add-to-alist 'return-map key (list return) T))
return-map)
(defun-r 'combine-handrail-return-fabs)
@ -68,19 +56,24 @@ Returns nil when %rail-return-type returns nil"
(progn
(rail-return-common)
(setq top-centerline (+ (xd-value "dist_btwn" s1)
4.66
(?f (if (= (xd-value "rail_topmnt" s1) "1") 1.5))
(?f (if (= (xd-value "rail_topmnt" s2) "1") 1.5))))
4.66
(?f (if (= (xd-value "rail_topmnt" s1) "1") 1.5))
(?f (if (= (xd-value "rail_topmnt" s2) "1") 1.5))))
(cons (xd-value "finish" s1)
(append (list "HR"
(xd-value "number" s1)
(xd-value "level" s1)
(xd-value "sequence" s1)
(xd-value "ascend" s1)
(strcat (substr return-type 1 1) "-" (substr return-type 2 1))
(rtos top-centerline 2 2))
(apply (read (strcat "calc-" return-type "-return"))
(list s1 s2)))))))
(append
(#! '(("mark" "HR")
("stair_number" #(xd-value "number" s1))
("level" #(xd-value "level" s1))
("sequence" #(xd-value "sequence" s1))
("ascend" #(xd-value "ascend" s1))
("detail" #(strcat
(substr return-type 1 1) "-" (substr return-type 2 1)))
("top_rail_centerline" #(rtos top-centerline 2 2))))
(mapcar 'list
'("line_1" "angle_1" "line_2" "angle_2" "line_3" "angle_3" "line_4" "angle_4"
"cut_length" "rotation")
(apply (read (strcat "calc-" return-type "-return"))
(list s1 s2))))))))
(defun-r 'calc-handrail-return-fab)
(defun-q pad-return-lines (lines / len)

@ -72,11 +72,17 @@ HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 5 1/2,SA,std,Screw anchor
HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 7,SA,xtra,Screw anchor
HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 8,SA,xtra,Screw anchor
HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 9,SA,xtra,Screw anchor
HILTI KH-EZ CRC SCREW ANCHOR 5/8 DIA. x 5 1/2,SA,xtra,Screw anchor
T.C. BOLT (A325) 5/8 DIA. x 1 1/2,TC,std,Bolt
T.C. BOLT (A325) 5/8 DIA. x 2,TC,xtra,Bolt
T.C. BOLT (A325) 5/8 DIA. x 4,TC,xtra,Bolt
T.C. BOLT (A325) 3/4 DIA. x 1 1/2,TC,xtra,Bolt
T.C. BOLT (A325) 1 DIA. x 3 1/2,TC,xtra,Bolt
GALVANIZED T.C. BOLT (A325) 5/8 DIA. x 1 1/2,TC,xtra,Bolt
GALVANIZED T.C. BOLT (A325) 5/8 DIA. x 2,TC,xtra,Bolt
GALVANIZED T.C. BOLT (A325) 5/8 DIA. x 4,TC,xtra,Bolt
GALVANIZED T.C. BOLT (A325) 3/4 DIA. x 1 1/2,TC,xtra,Bolt
GALVANIZED T.C. BOLT (A325) 1 DIA. x 3 1/2,TC,xtra,Bolt
HEX BOLT (A307) 1/2 DIA. x 1,HB,xtra,Bolt
HEX BOLT (A307) 1/2 DIA. x 1 1/2,HB,xtra,Bolt
HEX BOLT (A307) 1/2 DIA. x 3,HB,xtra,Bolt
@ -103,29 +109,78 @@ HEX BOLT (A325) 3/4 DIA. x 6,HB,xtra,Bolt
HEX BOLT (A325) 3/4 DIA. x 7,HB,xtra,Bolt
HEX BOLT (A325) 3/4 DIA. x 7 1/2,HB,xtra,Bolt
HEX BOLT (A325) 3/4 DIA. x 8,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 1/2 DIA. x 1,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 1/2 DIA. x 1 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 1/2 DIA. x 3,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 1 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 2 1/4,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 3,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 4,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 4 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 5,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 5 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 6,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 7,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 7 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 8,HB,xtra,Bolt
GALVANIZED HEX BOLT (A307) 5/8 DIA. x 10 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 5/8 DIA. x 1,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 5/8 DIA. x 1 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 5/8 DIA. x 2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 5/8 DIA. x 5,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 5/8 DIA. x 7 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 5/8 DIA. x 8 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 3/4 DIA. x 6,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 3/4 DIA. x 7,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 3/4 DIA. x 7 1/2,HB,xtra,Bolt
GALVANIZED HEX BOLT (A325) 3/4 DIA. x 8,HB,xtra,Bolt
HEX NUT 3/8 DIA.,HN,xtra,Nut
HEX NUT 1/2 DIA.,HN,xtra,Nut
HEX NUT 5/8 DIA.,HN,std,Nut
HEX NUT 3/4 DIA.,HN,std,Nut
HEX NUT 7/8 DIA.,HN,xtra,Nut
HEX NUT 1 DIA.,HN,std,Nut
GALVANIZED HEX NUT 3/8 DIA.,HN,xtra,Nut
GALVANIZED HEX NUT 1/2 DIA.,HN,xtra,Nut
GALVANIZED HEX NUT 5/8 DIA.,HN,xtra,Nut
GALVANIZED HEX NUT 3/4 DIA.,HN,xtra,Nut
GALVANIZED HEX NUT 7/8 DIA.,HN,xtra,Nut
GALVANIZED HEX NUT 1 DIA.,HN,xtra,Nut
COUPLER NUT 3/4 DIA.,CN,std,Nut
COUPLER NUT 1 DIA.,CN,std,Nut
GALVANIZED COUPLER NUT 3/4 DIA.,CN,xtra,Nut
GALVANIZED COUPLER NUT 1 DIA.,CN,xtra,Nut
BEVEL WASHER 5/8 DIA.,BW,std,Washer
BEVEL WASHER 7/8 DIA.,BW,xtra,Washer
BEVEL WASHER 1 DIA.,BW,xtra,Washer
GALVANIZED BEVEL WASHER 5/8 DIA.,BW,xtra,Washer
GALVANIZED BEVEL WASHER 7/8 DIA.,BW,xtra,Washer
GALVANIZED BEVEL WASHER 1 DIA.,BW,xtra,Washer
FLAT WASHER 3/8 DIA.,FW,xtra,Washer
FLAT WASHER 1/2 DIA.,FW,xtra,Washer
FLAT WASHER 5/8 DIA.,FW,std,Washer
FLAT WASHER 3/4 DIA.,FW,std,Washer
FLAT WASHER 7/8 DIA.,FW,xtra,Washer
FLAT WASHER 1 DIA.,FW,std,Washer
GALVANIZED FLAT WASHER 3/8 DIA.,FW,xtra,Washer
GALVANIZED FLAT WASHER 1/2 DIA.,FW,xtra,Washer
GALVANIZED FLAT WASHER 5/8 DIA.,FW,xtra,Washer
GALVANIZED FLAT WASHER 3/4 DIA.,FW,xtra,Washer
GALVANIZED FLAT WASHER 7/8 DIA.,FW,xtra,Washer
GALVANIZED FLAT WASHER 1 DIA.,FW,xtra,Washer
LOCK WASHER 3/8 DIA.,LW,xtra,Washer
LOCK WASHER 1/2 DIA.,LW,xtra,Washer
LOCK WASHER 5/8 DIA.,LW,std,Washer
LOCK WASHER 3/4 DIA.,LW,std,Washer
LOCK WASHER 7/8 DIA.,LW,std,Washer
LOCK WASHER 1 DIA.,LW,xtra,Washer
GALVANIZED LOCK WASHER 3/8 DIA.,LW,xtra,Washer
GALVANIZED LOCK WASHER 1/2 DIA.,LW,xtra,Washer
GALVANIZED LOCK WASHER 5/8 DIA.,LW,xtra,Washer
GALVANIZED LOCK WASHER 3/4 DIA.,LW,xtra,Washer
GALVANIZED LOCK WASHER 7/8 DIA.,LW,xtra,Washer
GALVANIZED LOCK WASHER 1 DIA.,LW,xtra,Washer
LAG SCREW 3/8 DIA. x 3,LS,xtra,Lag screw
LAG SCREW 3/8 DIA. x 4 1/2,LS,xtra,Lag screw
LAG SCREW 3/8 DIA. x 4,LS,xtra,Lag screw
@ -139,6 +194,19 @@ LAG SCREW 5/8 DIA. x 5,LS,xtra,Lag screw
LAG SCREW 5/8 DIA. x 5 1/2,LS,xtra,Lag screw
LAG SCREW 3/4 DIA. x 5,LS,xtra,Lag screw
LAG SCREW 3/4 DIA. x 6,LS,xtra,Lag screw
GALVANIZED LAG SCREW 3/8 DIA. x 3,LS,xtra,Lag screw
GALVANIZED LAG SCREW 3/8 DIA. x 4 1/2,LS,xtra,Lag screw
GALVANIZED LAG SCREW 3/8 DIA. x 4,LS,xtra,Lag screw
GALVANIZED LAG SCREW 1/2 DIA. x 2,LS,xtra,Lag screw
GALVANIZED LAG SCREW 1/2 DIA. x 5,LS,xtra,Lag screw
GALVANIZED LAG SCREW 5/8 DIA. x 3,LS,xtra,Lag screw
GALVANIZED LAG SCREW 5/8 DIA. x 3 1/2,LS,xtra,Lag screw
GALVANIZED LAG SCREW 5/8 DIA. x 4,LS,xtra,Lag screw
GALVANIZED LAG SCREW 5/8 DIA. x 4 1/2,LS,xtra,Lag screw
GALVANIZED LAG SCREW 5/8 DIA. x 5,LS,xtra,Lag screw
GALVANIZED LAG SCREW 5/8 DIA. x 5 1/2,LS,xtra,Lag screw
GALVANIZED LAG SCREW 3/4 DIA. x 5,LS,xtra,Lag screw
GALVANIZED LAG SCREW 3/4 DIA. x 6,LS,xtra,Lag screw
DRIVE NAIL 1/4 x 2,DN,std,Nail
DRIVE NAIL 1/4 x 3 1/2,DN,xtra,Nail
TEK SCREW #10 x 1/2,TK,xtra,Screw
@ -149,5 +217,6 @@ TEK SCREW #12 x 3,TK,std,Screw
3/4 x 4 NELSON STUD,NS,xtra,Stud
3/4 x 6 NELSON STUD,NS,xtra,Stud
ALL THREAD 5/8 DIA. x 2,AT,std,Misc
GALVANIZED ALL THREAD 5/8 DIA. x 2,AT,xtra,Misc
GALVANIZED SPRAY,GS,xtra,Misc
DRIVE PIN 3/16 x 5/8,DP,xtra,Misc

1 HILTI KB-TZ2 WEDGE ANCHOR 3/8 DIA. x 3 3/4 EA xtra TZ2 wedge anchor
72 HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 7 SA xtra Screw anchor
73 HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 8 SA xtra Screw anchor
74 HILTI KH-EZ SCREW ANCHOR 3/4 DIA. x 9 SA xtra Screw anchor
75 HILTI KH-EZ CRC SCREW ANCHOR 5/8 DIA. x 5 1/2 SA xtra Screw anchor
76 T.C. BOLT (A325) 5/8 DIA. x 1 1/2 TC std Bolt
77 T.C. BOLT (A325) 5/8 DIA. x 2 TC xtra Bolt
78 T.C. BOLT (A325) 5/8 DIA. x 4 TC xtra Bolt
79 T.C. BOLT (A325) 3/4 DIA. x 1 1/2 TC xtra Bolt
80 T.C. BOLT (A325) 1 DIA. x 3 1/2 TC xtra Bolt
81 GALVANIZED T.C. BOLT (A325) 5/8 DIA. x 1 1/2 TC xtra Bolt
82 GALVANIZED T.C. BOLT (A325) 5/8 DIA. x 2 TC xtra Bolt
83 GALVANIZED T.C. BOLT (A325) 5/8 DIA. x 4 TC xtra Bolt
84 GALVANIZED T.C. BOLT (A325) 3/4 DIA. x 1 1/2 TC xtra Bolt
85 GALVANIZED T.C. BOLT (A325) 1 DIA. x 3 1/2 TC xtra Bolt
86 HEX BOLT (A307) 1/2 DIA. x 1 HB xtra Bolt
87 HEX BOLT (A307) 1/2 DIA. x 1 1/2 HB xtra Bolt
88 HEX BOLT (A307) 1/2 DIA. x 3 HB xtra Bolt
109 HEX BOLT (A325) 3/4 DIA. x 7 HB xtra Bolt
110 HEX BOLT (A325) 3/4 DIA. x 7 1/2 HB xtra Bolt
111 HEX BOLT (A325) 3/4 DIA. x 8 HB xtra Bolt
112 GALVANIZED HEX BOLT (A307) 1/2 DIA. x 1 HB xtra Bolt
113 GALVANIZED HEX BOLT (A307) 1/2 DIA. x 1 1/2 HB xtra Bolt
114 GALVANIZED HEX BOLT (A307) 1/2 DIA. x 3 HB xtra Bolt
115 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 1 1/2 HB xtra Bolt
116 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 2 HB xtra Bolt
117 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 2 1/4 HB xtra Bolt
118 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 3 HB xtra Bolt
119 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 4 HB xtra Bolt
120 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 4 1/2 HB xtra Bolt
121 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 5 HB xtra Bolt
122 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 5 1/2 HB xtra Bolt
123 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 6 HB xtra Bolt
124 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 7 HB xtra Bolt
125 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 7 1/2 HB xtra Bolt
126 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 8 HB xtra Bolt
127 GALVANIZED HEX BOLT (A307) 5/8 DIA. x 10 1/2 HB xtra Bolt
128 GALVANIZED HEX BOLT (A325) 5/8 DIA. x 1 HB xtra Bolt
129 GALVANIZED HEX BOLT (A325) 5/8 DIA. x 1 1/2 HB xtra Bolt
130 GALVANIZED HEX BOLT (A325) 5/8 DIA. x 2 HB xtra Bolt
131 GALVANIZED HEX BOLT (A325) 5/8 DIA. x 5 HB xtra Bolt
132 GALVANIZED HEX BOLT (A325) 5/8 DIA. x 7 1/2 HB xtra Bolt
133 GALVANIZED HEX BOLT (A325) 5/8 DIA. x 8 1/2 HB xtra Bolt
134 GALVANIZED HEX BOLT (A325) 3/4 DIA. x 6 HB xtra Bolt
135 GALVANIZED HEX BOLT (A325) 3/4 DIA. x 7 HB xtra Bolt
136 GALVANIZED HEX BOLT (A325) 3/4 DIA. x 7 1/2 HB xtra Bolt
137 GALVANIZED HEX BOLT (A325) 3/4 DIA. x 8 HB xtra Bolt
138 HEX NUT 3/8 DIA. HN xtra Nut
139 HEX NUT 1/2 DIA. HN xtra Nut
140 HEX NUT 5/8 DIA. HN std Nut
141 HEX NUT 3/4 DIA. HN std Nut
142 HEX NUT 7/8 DIA. HN xtra Nut
143 HEX NUT 1 DIA. HN std Nut
144 GALVANIZED HEX NUT 3/8 DIA. HN xtra Nut
145 GALVANIZED HEX NUT 1/2 DIA. HN xtra Nut
146 GALVANIZED HEX NUT 5/8 DIA. HN xtra Nut
147 GALVANIZED HEX NUT 3/4 DIA. HN xtra Nut
148 GALVANIZED HEX NUT 7/8 DIA. HN xtra Nut
149 GALVANIZED HEX NUT 1 DIA. HN xtra Nut
150 COUPLER NUT 3/4 DIA. CN std Nut
151 COUPLER NUT 1 DIA. CN std Nut
152 GALVANIZED COUPLER NUT 3/4 DIA. CN xtra Nut
153 GALVANIZED COUPLER NUT 1 DIA. CN xtra Nut
154 BEVEL WASHER 5/8 DIA. BW std Washer
155 BEVEL WASHER 7/8 DIA. BW xtra Washer
156 BEVEL WASHER 1 DIA. BW xtra Washer
157 GALVANIZED BEVEL WASHER 5/8 DIA. BW xtra Washer
158 GALVANIZED BEVEL WASHER 7/8 DIA. BW xtra Washer
159 GALVANIZED BEVEL WASHER 1 DIA. BW xtra Washer
160 FLAT WASHER 3/8 DIA. FW xtra Washer
161 FLAT WASHER 1/2 DIA. FW xtra Washer
162 FLAT WASHER 5/8 DIA. FW std Washer
163 FLAT WASHER 3/4 DIA. FW std Washer
164 FLAT WASHER 7/8 DIA. FW xtra Washer
165 FLAT WASHER 1 DIA. FW std Washer
166 GALVANIZED FLAT WASHER 3/8 DIA. FW xtra Washer
167 GALVANIZED FLAT WASHER 1/2 DIA. FW xtra Washer
168 GALVANIZED FLAT WASHER 5/8 DIA. FW xtra Washer
169 GALVANIZED FLAT WASHER 3/4 DIA. FW xtra Washer
170 GALVANIZED FLAT WASHER 7/8 DIA. FW xtra Washer
171 GALVANIZED FLAT WASHER 1 DIA. FW xtra Washer
172 LOCK WASHER 3/8 DIA. LW xtra Washer
173 LOCK WASHER 1/2 DIA. LW xtra Washer
174 LOCK WASHER 5/8 DIA. LW std Washer
175 LOCK WASHER 3/4 DIA. LW std Washer
176 LOCK WASHER 7/8 DIA. LW std Washer
177 LOCK WASHER 1 DIA. LW xtra Washer
178 GALVANIZED LOCK WASHER 3/8 DIA. LW xtra Washer
179 GALVANIZED LOCK WASHER 1/2 DIA. LW xtra Washer
180 GALVANIZED LOCK WASHER 5/8 DIA. LW xtra Washer
181 GALVANIZED LOCK WASHER 3/4 DIA. LW xtra Washer
182 GALVANIZED LOCK WASHER 7/8 DIA. LW xtra Washer
183 GALVANIZED LOCK WASHER 1 DIA. LW xtra Washer
184 LAG SCREW 3/8 DIA. x 3 LS xtra Lag screw
185 LAG SCREW 3/8 DIA. x 4 1/2 LS xtra Lag screw
186 LAG SCREW 3/8 DIA. x 4 LS xtra Lag screw
194 LAG SCREW 5/8 DIA. x 5 1/2 LS xtra Lag screw
195 LAG SCREW 3/4 DIA. x 5 LS xtra Lag screw
196 LAG SCREW 3/4 DIA. x 6 LS xtra Lag screw
197 GALVANIZED LAG SCREW 3/8 DIA. x 3 LS xtra Lag screw
198 GALVANIZED LAG SCREW 3/8 DIA. x 4 1/2 LS xtra Lag screw
199 GALVANIZED LAG SCREW 3/8 DIA. x 4 LS xtra Lag screw
200 GALVANIZED LAG SCREW 1/2 DIA. x 2 LS xtra Lag screw
201 GALVANIZED LAG SCREW 1/2 DIA. x 5 LS xtra Lag screw
202 GALVANIZED LAG SCREW 5/8 DIA. x 3 LS xtra Lag screw
203 GALVANIZED LAG SCREW 5/8 DIA. x 3 1/2 LS xtra Lag screw
204 GALVANIZED LAG SCREW 5/8 DIA. x 4 LS xtra Lag screw
205 GALVANIZED LAG SCREW 5/8 DIA. x 4 1/2 LS xtra Lag screw
206 GALVANIZED LAG SCREW 5/8 DIA. x 5 LS xtra Lag screw
207 GALVANIZED LAG SCREW 5/8 DIA. x 5 1/2 LS xtra Lag screw
208 GALVANIZED LAG SCREW 3/4 DIA. x 5 LS xtra Lag screw
209 GALVANIZED LAG SCREW 3/4 DIA. x 6 LS xtra Lag screw
210 DRIVE NAIL 1/4 x 2 DN std Nail
211 DRIVE NAIL 1/4 x 3 1/2 DN xtra Nail
212 TEK SCREW #10 x 1/2 TK xtra Screw
217 3/4 x 4 NELSON STUD NS xtra Stud
218 3/4 x 6 NELSON STUD NS xtra Stud
219 ALL THREAD 5/8 DIA. x 2 AT std Misc
220 GALVANIZED ALL THREAD 5/8 DIA. x 2 AT xtra Misc
221 GALVANIZED SPRAY GS xtra Misc
222 DRIVE PIN 3/16 x 5/8 DP xtra Misc

@ -20,28 +20,5 @@ hardware : dialog {
height = 30;
}
: row {
: edit5_box {
label = "Qty";
key = "qty";
fixed_width = true;
width = 10;
}
: edit_box {
label = "Description";
key = "desc";
is_enabled = false;
fixed_width = true;
width = 50;
}
}
: toggle {
label = "Ship loose";
key = "sl";
}
save_cancel;
}

@ -183,8 +183,7 @@
"bolt-slots"
)
"id"))
(mat-table-add-data (1- (vla-get-Rows mat-table))
(mapcar 'append-mark-and-weight chan-mat)))
(table-add-data mat-table (mapcar 'process-material chan-mat)))
;; set local symbols for channel props
(defun land-fab-set-chan-props (fb props)

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)

@ -10,8 +10,7 @@
decking-def (land-fab-platform-100-calc-decking))
(append! 'material (combine-like-data edge-forms-def '("desc" "length" "width" "detail") "id"))
(add-to-list 'material decking-def)
(mat-table-add-data (1- (vla-get-Rows mat-table))
(mapcar 'append-mark-and-weight (strip-nil material)))
(table-add-data mat-table (mapcar 'process-material (strip-nil material)))
(land-fab-platform-100-draw-decking decking-def)
(land-fab-platform-100-draw-edge-forms edge-forms-def)
;; top view dim
@ -330,28 +329,21 @@
(add-to-list 'material tube-def))
(add-to-list 'material can-def)
(add-to-list 'material chk-def)
(mat-table-add-data (1- (vla-get-Rows mat-table))
(mapcar 'append-mark-and-weight (strip-nil material)))
(table-add-data mat-table (mapcar 'process-material (strip-nil material)))
(if (= quiet_tread "1")
(mat-table-add-data
(1- (vla-get-Rows mat-table))
(mapcar '(lambda(x / id mark desc)
(#! '(("mark" #(strcat "QT" (caar x)))
("qty" #(cadr x))
("desc" "QUIET TREAD 1/8")
("width" #(cadar x))
("length" #(caddar x))
("weight" #(calc-weight-formula "QUIET TREAD 1/8")))))
(land-qt-takeoff))))
(table-add-data mat-table
(mapcar '(lambda(x / id mark desc)
(#! '(("mark" #(strcat "QT" (caar x)))
("qty" #(cadr x))
("desc" "QUIET TREAD 1/8")
("width" #(cadar x))
("length" #(caddar x)))))
(land-qt-takeoff))))
(if galv-p
((lambda(/ tbl)
(setq tbl (get-table-by-title "Hardware"))
(table-insert-rows tbl 1 2)
(hdw-table-set-row tbl 2
(#! '(("qty" #(* 3 (xd-value "qty" can-def)))
("desc" "DRIVE PIN 3/16 x 5/8")))))))
(table-add-data (get-table-by-title "Hardware")
(#! '(("qty" #(* 3 (xd-value "qty" can-def)))
("desc" "DRIVE PIN 3/16 x 5/8")))))
(land-fab-platform-200-draw-cans can-def)
(if (= quiet_tread "1") (land-fab-platform-200-draw-qt))

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)

@ -1,36 +1,62 @@
(psc-include '("fab/land-ledger.lsp"
"fab/land-post.lsp"
"fab/land-hanger.lsp"
"fab/land-xbrace.lsp"))
(set-file-docstring "Functions for ship loose landing fabs
(defun make-land-sl-fabs (lands / ledger-map post-map hanger-map brace-map)
;; calc posts
(foreach result (mapcar '(lambda(land) (with-data land '((calc-land-sl-posts))))
lands)
(add-to-alist 'post-map (car result) (cdr result) T))
;; calc hangers
(foreach result (mapcar '(lambda(land) (with-data land '((calc-land-sl-hangers))))
lands)
(add-to-alist 'hanger-map (car result) (cdr result) T))
;; calc ledgers
(foreach result (mapcar '(lambda(land) (with-data land '((calc-land-sl-ledgers))))
lands)
(add-to-alist 'ledger-map (car result) (cdr result) T))
;; calc x bracing
(foreach result (mapcar '(lambda(land) (with-data land '((calc-land-sl-xbraces))))
lands)
(add-to-alist 'brace-map (car result) (cdr result) T))
(if post-map
(make-land-sl-post-fabs post-map))
(if hanger-map
(make-land-sl-hanger-fabs hanger-map))
(if ledger-map
(make-land-sl-ledger-fabs ledger-map))
(if brace-map
(make-land-sl-xbrace-fabs brace-map)))
New ship loose piece types should be added to LAND-SL--FAB-TYPES")
;; return the next available ship loose drawing number
(defun land-fab-calc-sl-dwg-no (jobno stairno / files-with-matching-sigil last-char)
(setq land-sl--fab-types '("hanger" "ledger" "post"))
;; auto includes for all fab types
(psc-include (mapcar '(lambda(ft) (strcat "fab/land-" ft ".lsp")) land-sl--fab-types))
(defun-q land-sl-make-fabs (lands fab-type / finish-map)
"Makes ship loose landing fabs of type FAB-TYPE for LANDS"
(declare (vars (lands list (vl-every 'data-list-p lands))
(fab-type str (member fab-type land-sl--fab-types))))
(foreach land (mapcar '(lambda(ld) (land-sl--calc fab-type ld)) lands)
(add-to-alist 'finish-map (car land) (cdr land) T))
(mapcar '(lambda(lands / finish)
(setq finish (pop! 'lands))
(while lands
((lambda(/ material hardware land)
(while (and lands (< (length material) 85))
(setq land (pop! 'lands)
material (append material (car land))
hardware (append hardware (cadr land))))
(land-sl--make-fab fab-type finish material hardware)))))
finish-map))
(defun-r 'land-sl-make-fabs)
(defun-q land-sl--make-fab (fab-type finish material hardware / dwgno path login modelspace)
"Makes a ship loose landing fab of FAB-TYPE"
(declare (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))))
(setq dwgno (land-sl--calc-dwg-no jobno stairno))
(setq path (vla-get-Path acadDoc)
login (getvar 'loginname)
acadDoc (vla-Add (vla-get-Documents acadObj)
(strcat psc-src-dir "fab/land-" fab-type ".dwt"))
modelspace (vla-get-ModelSpace acadDoc))
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
(write-title-block job-info stairno login (strcat "SHIP LOOSE "(uppercase fab-type) "S"))
(set-finish finish)
(table-add-data (get-table-by-title "Misc Material")
((lambda(/ mark i)
(setq mark (next-mark-prefix)
i 0)
(mapcar '(lambda(m) (cons (list "mark" (strcat mark (to-string (inc! 'i)))) m))
material))))
(table-add-data (get-table-by-title "Misc Hardware")
(combine-like-data hardware '("desc" "note") nil))
(vla-Regen acadDoc acAllViewports)
(vla-SaveAs acadDoc (strcat path "/" dwgno ".dwg"))
(if (not *dev-mode*) (vla-Close acadDoc))
(reset-doc))
(defun-r 'land-sl--make-fab)
(defun-q land-sl--calc-dwg-no (jobno stairno / files-with-matching-sigil last-char)
"Returns the next available ship loose drawing number"
(declare (vars (jobno str)
(stairno str)))
(setq files-with-matching-sigil (vl-remove-if-not
'(lambda (x)
(wcmatch x (strcat jobno
@ -43,50 +69,34 @@
(+ (strlen jobno) (strlen stairno) 5)
1)))
(strcat jobno "-L" stairno ".0" (chr (1+ (car (vl-string->list (?? last-char (chr 96))))))))
(defun-r 'land-sl--calc-dwg-no)
(defun land-fab-write-sl-main-table (title data total-cols / tbl row col colchr)
(setq tbl (get-table-by-title title)
row 2)
(table-insert-rows tbl (length data) 3)
(vla-put-RegenerateTableSuppressed tbl :vlax-true)
(mapcar! '(lambda(lst)
(mapcar '(lambda(elt) (if (= elt "0") "" elt)) lst))
'data)
(foreach d data
(setq col -1)
(inc! 'row)
(foreach x d (vla-SetText tbl row (inc! 'col) x)))
;; totals row
(setq row (1- (vla-get-Rows tbl)))
(foreach col total-cols
(if (> col 25)
(setq colchr (strcat "A" (chr (+ (ascii "A") (- col 26)))))
(setq colchr (chr (+ (ascii "A") col))))
;; only write total if there is something in the column
((lambda(/ r)
(setq r 3)
(while (< r row)
(if (/= (vla-GetText tbl r col) "")
(progn
(setq r row)
(vla-SetText tbl row col
(strcat "=SUM("
colchr
"4:"
colchr
(to-string row)
")"))))
(inc! 'r)))))
(vla-put-RegenerateTableSuppressed tbl :vlax-false))
(defun-q land-sl--calc (fab-type land-data / material hardware add-material add-hardware)
"Calculates ship loose pieces for a landing
(defun land-fab-write-sl-qty-table (data / tbl row)
(setq tbl (get-table-by-title "Qty Summary")
row 1)
(table-insert-rows tbl (length data) 2)
(vla-put-RegenerateTableSuppressed tbl :vlax-true)
(foreach d data
(inc! 'row)
(vla-SetText tbl row 0 (car d))
(vla-SetText tbl row 1 (to-string (cadr d))))
(vla-put-RegenerateTableSuppressed tbl :vlax-false))
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."
(declare (vars (fab-type str (member fab-type land-sl--fab-types))
(land-data list (data-list-p land-data))))
(defun add-material (mat) (add-to-list 'material (append base (#! mat))))
(defun add-hardware (hdw)
(setq hdw (#! hdw))
(add-to-list 'hardware
(if (= finish "Galvanized")
(subst-key "desc" (hardware-galv-desc (xd-value "desc" hdw)) hdw)
hdw)))
(with-data land-data
'((setq base (#! '(("piece_type" "P")
("stair_number" #number)
("level" #level)
("sequence" #sequence))))
(foreach corner '("fl" "fr" "bl" "br")
(if (apply (read (strcat "land-" fab-type "-p")) (list corner))
(apply (read (strcat "land-" fab-type "-calc")) (list corner))))
(if material
(list
finish
(list
(combine-like-data material '("detail" "desc" "width" "length" "note") nil)
(combine-like-data hardware '("desc" "note") nil)))))))
(defun-r 'land-sl--calc)

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))

@ -41,7 +41,7 @@ Essentially a composition of %make-generic-fab and %fab-combine-lands"
;; this function assumes it is called by make-generic-fab and thus has access
;; to all local vars in make-generic-fab
(defun make-land-fab ( /
append-mark-and-weight
process-material
current-mark-no
marks
top-front-insx
@ -62,10 +62,10 @@ Essentially a composition of %make-generic-fab and %fab-combine-lands"
galv-p
part-details
)
;; add mark and weight to a material list item
;; add mark to a material list item
;; add ids to marks list
;; add details to part-details
(defun append-mark-and-weight (data / mark)
(defun process-material (data / mark)
(setq mark (strcat piece-mark (to-string (post-inc! 'current-mark-no))))
(add-to-list 'data (list "mark" mark))
(foreach id (xd-value "id" data)
@ -74,7 +74,7 @@ Essentially a composition of %make-generic-fab and %fab-combine-lands"
(add-to-list 'part-details
(#! '(("mark" #mark)
#(assoc "detail" data))))))
(add-to-list 'data (list "weight" (calc-weight-formula (xd-value "desc" data)))))
data)
;; update assemblies table title
(vla-SetCellState ass-table 0 0 acCellStateNone)
@ -87,7 +87,6 @@ Essentially a composition of %make-generic-fab and %fab-combine-lands"
(to-string (fix plt_wid))
" x "
(to-string (fix plt_dpt))))
(vla-SetCellState ass-table 0 0 acCellStateContentLocked)
(setq current-mark-no 1
top-front-insx (+ (* dimspace 4) (max fl_ext bl_ext))

@ -1,4 +1,4 @@
ANGLE 12 x 12 x 1 3/8,105,foot,xtra,Angle,AN,
ANGLE 12 x 12 x 1 3/8,105.0,foot,xtra,Angle,AN,
ANGLE 12 x 12 x 1 1/4,96.4,foot,xtra,Angle,AN,
ANGLE 12 x 12 x 1 1/8,87.2,foot,xtra,Angle,AN,
ANGLE 12 x 12 x 1,77.8,foot,xtra,Angle,AN,
@ -9,8 +9,8 @@ ANGLE 10 x 10 x 1,64.7,foot,xtra,Angle,AN,
ANGLE 10 x 10 x 7/8,56.9,foot,xtra,Angle,AN,
ANGLE 10 x 10 x 3/4,49.1,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 1 1/8,56.9,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 1,51,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 7/8,45,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 1,51.0,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 7/8,45.0,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 3/4,38.9,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 5/8,32.7,foot,xtra,Angle,AN,
ANGLE 8 x 8 x 9/16,29.6,foot,xtra,Angle,AN,
@ -20,7 +20,7 @@ ANGLE 8 x 6 x 7/8,39.1,foot,xtra,Angle,AN,
ANGLE 8 x 6 x 3/4,33.8,foot,xtra,Angle,AN,
ANGLE 8 x 6 x 5/8,28.5,foot,xtra,Angle,AN,
ANGLE 8 x 6 x 9/16,25.7,foot,xtra,Angle,AN,
ANGLE 8 x 6 x 1/2,23,foot,xtra,Angle,AN,
ANGLE 8 x 6 x 1/2,23.0,foot,xtra,Angle,AN,
ANGLE 8 x 6 x 7/16,20.2,foot,xtra,Angle,AN,
ANGLE 8 x 4 x 1,37.4,foot,xtra,Angle,AN,
ANGLE 8 x 4 x 7/8,33.1,foot,xtra,Angle,AN,
@ -45,7 +45,7 @@ ANGLE 6 x 6 x 3/8,14.9,foot,xtra,Angle,AN,
ANGLE 6 x 6 x 5/16,12.4,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 7/8,27.2,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 3/4,23.6,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 5/8,20,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 5/8,20.0,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 9/16,18.1,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 1/2,16.2,foot,xtra,Angle,AN,
ANGLE 6 x 4 x 7/16,14.3,foot,xtra,Angle,AN,
@ -56,7 +56,7 @@ ANGLE 6 x 3 1/2 x 3/8,11.7,foot,xtra,Angle,AN,
ANGLE 6 x 3 1/2 x 5/16,9.8,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 7/8,27.2,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 3/4,23.6,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 5/8,20,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 5/8,20.0,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 1/2,16.2,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 7/16,14.3,foot,xtra,Angle,AN,
ANGLE 5 x 5 x 3/8,12.3,foot,xtra,Angle,AN,
@ -66,7 +66,7 @@ ANGLE 5 x 3 1/2 x 5/8,16.8,foot,xtra,Angle,AN,
ANGLE 5 x 3 1/2 x 1/2,13.6,foot,xtra,Angle,AN,
ANGLE 5 x 3 1/2 x 3/8,10.4,foot,xtra,Angle,AN,
ANGLE 5 x 3 1/2 x 5/16,8.7,foot,xtra,Angle,AN,
ANGLE 5 x 3 1/2 x 1/4,7,foot,xtra,Angle,AN,
ANGLE 5 x 3 1/2 x 1/4,7.0,foot,xtra,Angle,AN,
ANGLE 5 x 3 x 1/2,12.8,foot,xtra,Angle,AN,
ANGLE 5 x 3 x 7/16,11.3,foot,xtra,Angle,AN,
ANGLE 5 x 3 x 3/8,9.8,foot,std,Angle,AN,
@ -107,21 +107,21 @@ ANGLE 3 x 3 x 7/16,8.3,foot,xtra,Angle,AN,
ANGLE 3 x 3 x 3/8,7.2,foot,xtra,Angle,AN,
ANGLE 3 x 3 x 5/16,6.1,foot,xtra,Angle,AN,
ANGLE 3 x 3 x 1/4,4.9,foot,std,Angle,AN,
ANGLE 3 x 3 x 3/16,3.71,foot,xtra,Angle,AN,
ANGLE 3 x 3 x 3/16,3.7,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 1/2,8.5,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 7/16,7.6,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 3/8,6.6,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 5/16,5.6,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 1/4,4.5,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 3/16,3.39,foot,xtra,Angle,AN,
ANGLE 3 x 2 1/2 x 3/16,3.4,foot,xtra,Angle,AN,
ANGLE 3 x 2 x 1/2,7.7,foot,xtra,Angle,AN,
ANGLE 3 x 2 x 3/8,5.9,foot,xtra,Angle,AN,
ANGLE 3 x 2 x 5/16,5,foot,xtra,Angle,AN,
ANGLE 3 x 2 x 5/16,5.0,foot,xtra,Angle,AN,
ANGLE 3 x 2 x 1/4,4.1,foot,std,Angle,AN,
ANGLE 3 x 2 x 3/16,3.07,foot,xtra,Angle,AN,
ANGLE 3 x 2 x 3/16,3.1,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 1/2 x 1/2,7.7,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 1/2 x 3/8,5.9,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 1/2 x 5/16,5,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 1/2 x 5/16,5.0,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 1/2 x 1/4,4.1,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 1/2 x 3/16,3.07,foot,xtra,Angle,AN,
ANGLE 2 1/2 x 2 x 3/8,5.3,foot,xtra,Angle,AN,
@ -135,18 +135,18 @@ ANGLE 2 x 2 x 5/16,3.92,foot,xtra,Angle,AN,
ANGLE 2 x 2 x 1/4,3.19,foot,std,Angle,AN,
ANGLE 2 x 2 x 3/16,2.44,foot,xtra,Angle,AN,
ANGLE 2 x 2 x 1/8,1.65,foot,xtra,Angle,AN,
CHANNEL C15 x 50,50,foot,xtra,Channel,CH,
CHANNEL C15 x 40,40,foot,xtra,Channel,CH,
CHANNEL C15 x 50,50.0,foot,xtra,Channel,CH,
CHANNEL C15 x 40,40.0,foot,xtra,Channel,CH,
CHANNEL C15 x 33.9,33.9,foot,xtra,Channel,CH,
CHANNEL C12 x 30,30,foot,xtra,Channel,CH,
CHANNEL C12 x 25,25,foot,xtra,Channel,CH,
CHANNEL C12 x 30,30.0,foot,xtra,Channel,CH,
CHANNEL C12 x 25,25.0,foot,xtra,Channel,CH,
CHANNEL C12 x 20.7,20.7,foot,std,Channel,CH,
CHANNEL C10 x 30,30,foot,xtra,Channel,CH,
CHANNEL C10 x 25,25,foot,xtra,Channel,CH,
CHANNEL C10 x 20,20,foot,xtra,Channel,CH,
CHANNEL C10 x 30,30.0,foot,xtra,Channel,CH,
CHANNEL C10 x 25,25.0,foot,xtra,Channel,CH,
CHANNEL C10 x 20,20.0,foot,xtra,Channel,CH,
CHANNEL C10 x 15.3,15.3,foot,std,Channel,CH,
CHANNEL C9 x 20,20,foot,xtra,Channel,CH,
CHANNEL C9 x 15,15,foot,xtra,Channel,CH,
CHANNEL C9 x 20,20.0,foot,xtra,Channel,CH,
CHANNEL C9 x 15,15.0,foot,xtra,Channel,CH,
CHANNEL C9 x 13.4,13.4,foot,xtra,Channel,CH,
CHANNEL C8 x 18.75,18.75,foot,xtra,Channel,CH,
CHANNEL C8 x 13.75,13.75,foot,xtra,Channel,CH,
@ -154,56 +154,56 @@ CHANNEL C8 x 11.5,11.5,foot,std,Channel,CH,
CHANNEL C7 x 14.75,14.75,foot,xtra,Channel,CH,
CHANNEL C7 x 12.25,12.25,foot,xtra,Channel,CH,
CHANNEL C7 x 9.8,9.8,foot,xtra,Channel,CH,
CHANNEL C6 x 13,13,foot,xtra,Channel,CH,
CHANNEL C6 x 13,13.0,foot,xtra,Channel,CH,
CHANNEL C6 x 10.5,10.5,foot,xtra,Channel,CH,
CHANNEL C6 x 8.2,8.2,foot,std,Channel,CH,
CHANNEL C5 x 9,9,foot,xtra,Channel,CH,
CHANNEL C5 x 9,9.0,foot,xtra,Channel,CH,
CHANNEL C5 x 6.7,6.7,foot,xtra,Channel,CH,
CHANNEL C4 x 7.25,7.25,foot,xtra,Channel,CH,
CHANNEL C4 x 6.25,6.25,foot,xtra,Channel,CH,
CHANNEL C4 x 5.4,5.4,foot,xtra,Channel,CH,
CHANNEL C4 x 4.5,4.5,foot,xtra,Channel,CH,
CHANNEL C3 x 6,6,foot,xtra,Channel,CH,
CHANNEL C3 x 5,5,foot,xtra,Channel,CH,
CHANNEL C3 x 6,6.0,foot,xtra,Channel,CH,
CHANNEL C3 x 5,5.0,foot,xtra,Channel,CH,
CHANNEL C3 x 4.1,4.1,foot,xtra,Channel,CH,
CHANNEL C3 x 3.5,3.5,foot,xtra,Channel,CH,
CHANNEL MC18 x 58,58,foot,xtra,Channel,CH,
CHANNEL MC18 x 58,58.0,foot,xtra,Channel,CH,
CHANNEL MC18 x 51.9,51.9,foot,xtra,Channel,CH,
CHANNEL MC18 x 45.8,45.8,foot,xtra,Channel,CH,
CHANNEL MC18 x 42.7,42.7,foot,xtra,Channel,CH,
CHANNEL MC13 x 50,50,foot,xtra,Channel,CH,
CHANNEL MC13 x 40,40,foot,xtra,Channel,CH,
CHANNEL MC13 x 35,35,foot,xtra,Channel,CH,
CHANNEL MC13 x 50,50.0,foot,xtra,Channel,CH,
CHANNEL MC13 x 40,40.0,foot,xtra,Channel,CH,
CHANNEL MC13 x 35,35.0,foot,xtra,Channel,CH,
CHANNEL MC13 x 31.8,31.8,foot,xtra,Channel,CH,
CHANNEL MC12 x 50,50,foot,xtra,Channel,CH,
CHANNEL MC12 x 45,45,foot,xtra,Channel,CH,
CHANNEL MC12 x 40,40,foot,xtra,Channel,CH,
CHANNEL MC12 x 35,35,foot,xtra,Channel,CH,
CHANNEL MC12 x 31,31,foot,xtra,Channel,CH,
CHANNEL MC12 x 50,50.0,foot,xtra,Channel,CH,
CHANNEL MC12 x 45,45.0,foot,xtra,Channel,CH,
CHANNEL MC12 x 40,40.0,foot,xtra,Channel,CH,
CHANNEL MC12 x 35,35.0,foot,xtra,Channel,CH,
CHANNEL MC12 x 31,31.0,foot,xtra,Channel,CH,
CHANNEL MC12 x 14.3,14.3,foot,xtra,Channel,CH,
CHANNEL MC12 x 10.6,10.6,foot,std,Channel,CH,
CHANNEL MC10 x 41.1,41.1,foot,xtra,Channel,CH,
CHANNEL MC10 x 33.6,33.6,foot,xtra,Channel,CH,
CHANNEL MC10 x 28.5,28.5,foot,xtra,Channel,CH,
CHANNEL MC10 x 25,25,foot,xtra,Channel,CH,
CHANNEL MC10 x 22,22,foot,xtra,Channel,CH,
CHANNEL MC10 x 25,25.0,foot,xtra,Channel,CH,
CHANNEL MC10 x 22,22.0,foot,xtra,Channel,CH,
CHANNEL MC10 x 8.4,8.4,foot,std,Channel,CH,
CHANNEL MC10 x 6.5,6.5,foot,xtra,Channel,CH,
CHANNEL MC9 x 25.4,25.4,foot,xtra,Channel,CH,
CHANNEL MC9 x 23.9,23.9,foot,xtra,Channel,CH,
CHANNEL MC8 x 22.8,22.8,foot,xtra,Channel,CH,
CHANNEL MC8 x 21.4,21.4,foot,xtra,Channel,CH,
CHANNEL MC8 x 20,20,foot,xtra,Channel,CH,
CHANNEL MC8 x 20,20.0,foot,xtra,Channel,CH,
CHANNEL MC8 x 18.7,18.7,foot,xtra,Channel,CH,
CHANNEL MC8 x 8.5,8.5,foot,xtra,Channel,CH,
CHANNEL MC7 x 22.7,22.7,foot,xtra,Channel,CH,
CHANNEL MC7 x 19.1,19.1,foot,xtra,Channel,CH,
CHANNEL MC6 x 18,18,foot,xtra,Channel,CH,
CHANNEL MC6 x 18,18.0,foot,xtra,Channel,CH,
CHANNEL MC6 x 15.3,15.3,foot,xtra,Channel,CH,
CHANNEL MC6 x 16.3,16.3,foot,xtra,Channel,CH,
CHANNEL MC6 x 15.1,15.1,foot,xtra,Channel,CH,
CHANNEL MC6 x 12,12,foot,xtra,Channel,CH,
CHANNEL MC6 x 7,7,foot,xtra,Channel,CH,
CHANNEL MC6 x 12,12.0,foot,xtra,Channel,CH,
CHANNEL MC6 x 7,7.0,foot,xtra,Channel,CH,
CHANNEL MC6 x 6.5,6.5,foot,xtra,Channel,CH,
CHANNEL MC4 x 13.8,13.8,foot,xtra,Channel,CH,
CHANNEL MC3 x 7.1,7.1,foot,xtra,Channel,CH,
@ -238,7 +238,7 @@ FLAT BAR 1/4 x 1 1/2,1.28,foot,std,Bar,FB,
FLAT BAR 1/4 x 2,1.7,foot,std,Bar,FB,
FLAT BAR 1/4 x 2 1/2,2.125,foot,xtra,Bar,FB,
FLAT BAR 1/4 x 3,2.55,foot,std,Bar,FB,
FLAT BAR 1/4 x 3 1/2,3,foot,std,Bar,FB,
FLAT BAR 1/4 x 3 1/2,3.0,foot,std,Bar,FB,
FLAT BAR 1/4 x 4,3.4,foot,std,Bar,FB,
FLAT BAR 1/4 x 4 1/2,3.825,foot,xtra,Bar,FB,
FLAT BAR 1/4 x 5,4.25,foot,xtra,Bar,FB,
@ -252,12 +252,13 @@ FLAT BAR 3/8 x 3,3.82,foot,xtra,Bar,FB,
FLAT BAR 3/8 x 4,5.1,foot,xtra,Bar,FB,
FLAT BAR 3/8 x 6,7.65,foot,std,Bar,FB,
FLAT BAR 3/8 x 8,10.2,foot,std,Bar,FB,
COLD DRAWN FLAT BAR 3/4 x 2,5.1,foot,xtra,Bar,FB
HSS 1 1/4 x 1 1/4 x 3/16,2.34,foot,std,HSS,HS,
HSS 1 1/2 x 3/4 x .083,1.16,foot,xtra,HSS,HS,
HSS 1 1/2 x 1 1/2 x .120,2.21,foot,std,HSS,HS,
HSS 2 x 2 x 1/4,5.4,foot,xtra,HSS,HS,
HSS 2 1/2 x 1 1/2 x .065,2.1,foot,std,HSS,HS,
HSS 2 1/2 x 1 1/2 x 1/4,5.93,foot,xtra,HSS,HS,
HSS 2 1/2 x 1 1/2 x 1/4,5.93,foot,std,HSS,HS,
HSS 1 1/2 x 1 1/2 x 1/4,4.25,foot,std,HSS,HS,
HSS 2 1/2 x 2 1/2 x 1/4,7.1,foot,std,HSS,HS,
HSS 3 x 1 1/2 x 1/4,6.25,foot,xtra,HSS,HS,
@ -266,7 +267,7 @@ HSS 3 x 3 x 1/4,8.8,foot,std,HSS,HS,
HSS 3 1/2 x 3 1/2 x 1/4,10.5,foot,xtra,HSS,HS,
HSS 4 x 4 x 1/4,12.2,foot,xtra,HSS,HS,
HSS 5 x 5 x 1/4,15.6,foot,xtra,HSS,HS,
HSS 6 x 6 x 1/4,19,foot,xtra,HSS,HS,
HSS 6 x 6 x 1/4,19.0,foot,xtra,HSS,HS,
HSS 8 x 4 x 3/8,27.5,foot,xtra,HSS,HS,
PIPE 3/4 DIA (1.05 OD) x 0.113,1.13,foot,std,Pipe,PI,
PIPE 1 1/4 DIA (1.66 OD) x 0.140,2.27,foot,std,Pipe,PI,
@ -281,6 +282,8 @@ ALL THREAD 3/4 DIA.,1.5,foot,std,Bar,AT,
ALL THREAD 1 DIA.,2.67,foot,std,Bar,AT,
ROUND BAR 1/2 DIA.,0.67,foot,std,Bar,RB,
ROUND BAR 5/8 DIA.,1.04,foot,std,Bar,RB,
COLD DRAWN ROUND BAR 1/2 DIA.,0.67,foot,xtra,Bar,RB,
BENT C-SHAPE ROUND BAR 5/8 DIA.,1.0,each,misc,Bar,RB,
SQUARE BAR 1/2,0.85,foot,std,Bar,SB,
GRATING 19-W-4 1 1/4 x 3/16,8.9,sqft,std,Misc,GR,
GRATING 11-W-4 1 1/4 x 3/16,14.7,sqft,xtra,Misc,GR,

Can't render this file because it has a wrong number of fields in line 255.

@ -21,58 +21,6 @@ material : dialog {
height = 30;
}
: row {
: edit12_box {
label = "Mark";
key = "mark";
fixed_width = true;
width = 25;
}
: edit12_box {
label = "Qty";
key = "qty";
fixed_width = true;
width = 25;
}
}
: row {
: edit12_box {
label = "Width";
key = "width";
fixed_width = true;
width = 25;
}
: edit12_box {
label = "Length";
key = "length";
fixed_width = true;
width = 25;
}
}
: edit_box {
label = "Description";
key = "desc";
is_enabled = false;
}
: boxed_row {
label = "Notes";
: toggle {
label = "Ship loose";
key = "sl";
}
: toggle {
label = "Laser cut";
key = "lc";
}
}
save_cancel;
}

Binary file not shown.

@ -1,26 +1,20 @@
;; functions for stair rail fabs
(set-file-docstring "Functions for stair rail fabs")
(psc-include '("rail/util.lsp"))
;; return a list of stair rail definitions
(defun calc-stair-rail-fab (stair-data
/
calc
ret
)
(defun-q calc-stair-rail-fab (stair-data
/
calc
ret
)
"Returns a list of 0-2 stair rail definitions for a stair"
(declare (vars (stair-data list (data-list-p stair-data))))
(defun calc (side
/ ret opcl cospitch npanels pcl series hpl t15 otherside)
(expect-with-data "calc-stair-rail-fab/calc")
(if (= (sidekey-rail "type") "Stair Rail")
(progn
(setq opcl (+ (- run 6.25)
(- bot_cdist 1.25)
(- top_cdist 1.25)
(if (wcmatch bot_conn "*haunch*")
(min tread_depth bot_ext)
bot_ext)
(sidekey-rail "top_ext")
(sidekey-rail "bot_ext"))
(setq opcl (calc-stair-rail-opcl side)
cospitch (cos (dtr pitch))
npanels (ceil (/ opcl 48.0))
pcl (/ opcl (float npanels))
@ -29,64 +23,62 @@
ret (#! '(("series" #series)
("finish" #finish)
("template" #(strcat "stair-rail-" (to-string series)))
("number" #number)
("mark" "SR")
("stair_number" #number)
("level" #level)
("sequence" #(rail-sequence side))
("ascend" #(rail-ascend side))
("pitch" #(rtos pitch 2 2))
("tread_depth" #(rtos tread_depth 2 0))
("rise_hgt" #(rtos rise_hgt 2 2))
("out_post_cl" #(frac opcl))
("num_posts" #(to-string (1+ npanels)))
("post_cl" #(frac pcl))
("top_cap" #(rtos (- (/ (- opcl 1.5) cospitch) 0.0625) 2 2))
("hg_len" #(cond ((and (= (sidekey-rail "top_dloop") "1")
(= (sidekey-rail "bot_dloop") "1"))
"DR")
((= (sidekey-rail "top_dloop") "1") "TR")
((= (sidekey-rail "bot_dloop") "1") "BR")
(t (rtos (+ 0.25 (/ (+ 0.25 opcl) cospitch)) 2 2)))))))
("rise_height" #(rtos rise_hgt 2 2))
("outside_post_centerline" #(frac opcl))
("#_of_posts" #(to-string (1+ npanels)))
("post_centerline" #(frac pcl))
("top_cap_length" #(rtos (- (/ (- opcl 1.5) cospitch) 0.0625) 2 2))
("handgrab_length" #(cond ((and (= (sidekey-rail "top_dloop") "1")
(= (sidekey-rail "bot_dloop") "1"))
"DR")
((= (sidekey-rail "top_dloop") "1") "TR")
((= (sidekey-rail "bot_dloop") "1") "BR")
(t (rtos (+ 0.25 (/ (+ 0.25 opcl) cospitch)) 2 2)))))))
(if (= (sidekey-rail "topmnt") "1")
(progn
(setq hpl (/ (- 38.375 (sidekey "nosing_mid")) cospitch)
t15 (* 1.5 (tan (dtr pitch))))
(subst-key! "template" (strcat (xd-value "template" ret) "-top") 'ret)
(append! 'ret (#! '(("high_post_len" #(rtos hpl 2 2))
("mid_post_len" #(rtos (/ (- 36.875 (sidekey "nosing_mid"))
cospitch)
2 2))
("low_post_len" #(rtos (+ hpl t15) 2 2))))))
(append! 'ret (#! '(("post_len" "50")
("gusset" #(if (sidekey "string_flg")
(rtos (- (sidekey "string_wid")
(sidekey "string_web"))
2 2)
""))))))
(append! 'ret (#! '(("high_post_length" #(rtos hpl 2 2))
("mid_post_length" #(rtos (/ (- 36.875 (sidekey "nosing_mid"))
cospitch)
2 2))
("low_post_length" #(rtos (+ hpl t15) 2 2))))))
(append! 'ret (#! '(("post_length" "50")
("gusset_length" #(if (sidekey "string_flg")
(rtos (- (sidekey "string_wid")
(sidekey "string_web"))
2 2)
""))))))
(cond ((= series 100)
(append ret
(#! '(("midline_len" #(rtos (/ (+ 0.25 opcl) cospitch) 2 2))))))
(append ret (#! '(("midline_length" #(rtos (/ (+ 0.25 opcl) cospitch) 2 2))))))
((= series 200)
(append ret
(#! '(("midline_len" #(rtos (/ (+ 0.25 opcl) cospitch) 2 2))
("int_hss_len" #(rtos (- (/ (- pcl 1.5) cospitch) 0.0625) 2 2))
("num_int_hss" #npanels)))))
(#! '(("midline_length" #(rtos (/ (+ 0.25 opcl) cospitch) 2 2))
("int_hss_length" #(rtos (- (/ (- pcl 1.5) cospitch) 0.0625) 2 2))
("#_of_int_hss" #npanels)))))
((= series 300)
(append ret
(#! '(("num_int_hss" #(* 6 npanels))
("int_hss_len" #(rtos (- (/ (- pcl 1.5) cospitch) 0.0625) 2 2))))))
(#! '(("#_of_int_hss" #(* 6 npanels))
("int_hss_length" #(rtos (- (/ (- pcl 1.5) cospitch) 0.0625) 2 2))))))
((= series 400)
(setq pspc (rail-calc-picket-spacing (- pcl 1.5)))
(append ret
(#! '(("int_hss_len" #(rtos (- (/ (- pcl 1.5) cospitch) 0.0625) 2 2))
("num_int_hss" #npanels)
("picket_len" #(rtos (- (/ 29.625 cospitch) 0.0625) 2 2))
("picket_spc" #(rtos pspc 2 2))
("num_pickets" #(rtos (* (/ (- pcl 1.5 pspc)
(+ pspc 0.5))
npanels)
2 0))))))
))))
(#! '(("int_hss_length" #(rtos (- (/ (- pcl 1.5) cospitch) 0.0625) 2 2))
("#_of_int_hss" #npanels)
("picket_length" #(rtos (- (/ 29.625 cospitch) 0.0625) 2 2))
("picket_spacing" #(rtos pspc 2 2))
("#_of_pickets" #(rtos (* (/ (- pcl 1.5 pspc)
(+ pspc 0.5))
npanels)
2 0))))))))))
(with-data stair-data '((setq ret nil)
(if (setq tmp (calc "i"))
@ -94,10 +86,13 @@
(if (setq tmp (calc "o"))
(add-to-list 'ret tmp))
ret)))
(defun-r 'calc-stair-rail-fab)
;; combine rail-datas based on template and finish
(defun combine-stair-rail-fabs (rail-datas
(defun-q combine-stair-rail-fabs (rail-datas
/ key keys rail-map returns)
"Combines RAIL-DATAS based on template and finish"
(declare (vars (rail-datas list (vl-every 'data-list-p rail-datas))))
(foreach rail rail-datas
(setq key (list (xd-value "template" rail)
(xd-value "finish" rail)))
@ -105,82 +100,38 @@
(add-to-list 'keys key))
(add-to-alist 'rail-map key (list rail) T))
rail-map)
(defun-r 'combine-stair-rail-fabs)
;; bundle rails and call make-stair-rail-fab
(defun make-stair-rail-fabs (stairs / rail-datas template finish rails)
(defun-q make-stair-rail-fabs (stairs / rail-datas template finish rails)
"Bundles rails and calls %make-stair-rail-fab"
(setq rail-datas (combine-stair-rail-fabs (map-append 'calc-stair-rail-fab stairs)))
(foreach x rail-datas
(setq template (caar x)
finish (cadar x)
rails (cdr x))
(while rails
(make-stair-rail-fab template finish (take! 58 'rails)))))
(make-stair-rail-fab template finish (take! 58 'rails)))))
(defun-r 'make-stair-rail-fabs)
;; open template and create standard stair rail fab drawing
(defun make-stair-rail-fab (template finish rail-datas)
(defun-q make-stair-rail-fab (template finish rail-datas)
"Opens TEMPLATE and creates a standard stair rail fab drawing"
(debug-print '("Making stair rail fab: " #template))
(make-rail-fab-common template '(stair-rail-write-table finish rail-datas)))
(defun-r 'make-stair-rail-fab)
;; write the table in a stair rail fab drawing
(defun stair-rail-write-table (finish rail-datas / row col table cols)
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
(defun-q stair-rail-write-table (finish rail-datas / row col table cols)
"Writes the table in a stair rail fab drawing"
(set-finish finish)
(table-add-data (get-table-by-title "*Stair Rails") rail-datas))
(defun-r 'stair-rail-write-table)
(setq cols '("number"
"level"
"sequence"
"ascend"
"pitch"
"tread_depth"
"rise_hgt"
"out_post_cl"
"post_cl"
"top_cap"
"hg_len"
"num_posts")
template (xd-value "template" (car rail-datas))
table (get-table-by-title "*Stair Rails*"))
(if (wcmatch template "*top*")
(append! 'cols '("high_post_len" "mid_post_len" "low_post_len"))
(append! 'cols '("post_len" "gusset")))
(append! 'cols
(cond ((wcmatch template "*100*") '("midline_len"))
((wcmatch template "*200*") '("num_int_hss" "int_hss_len" "midline_len"))
((wcmatch template "*300*") '("num_int_hss" "int_hss_len"))
((wcmatch template "*400*") '("num_int_hss"
"int_hss_len"
"num_pickets"
"picket_spc"
"picket_len"))))
(vla-put-RegenerateTableSuppressed table :vlax-true)
(table-insert-rows table (length rail-datas) 3)
(setq row 2)
(foreach rail rail-datas
(vla-SetText table (inc! 'row) 0 "SR")
(setq col 0)
(foreach key cols
(vla-SetText table row (inc! 'col) (to-string (xd-value key rail)))
(vla-Update table)))
(vla-put-RegenerateTableSuppressed table :vlax-false))
;; return 1- or 2-item list of returns for this rail
(defun calc-stair-rail-dloop (side
/ ret top-dloop-p bot-dloop-p lvl-p pad top-AB top-A top-B top-horiz
top-lines top-line-args bot-AB bot-A bot-B bot-horiz bot-detail
bot-lines bot-line-args overlong-p top-return)
(expect-with-data "calc-stair-rail-dloop")
;; ensure 20 elements in lst
(defun pad (lst / len limit)
(setq len (length lst)
limit 20)
(if (= len limit)
lst
(progn
(setq lst (reverse lst)
lst (cons (car lst) (append (lst* "" (- limit len))
(cdr lst)))
lst (reverse lst)))))
(defun-q calc-stair-rail-dloop (side
/ ret top-dloop-p bot-dloop-p lvl-p top-AB top-A top-B top-horiz
top-lines top-line-args bot-AB bot-A bot-B bot-horiz bot-detail
bot-lines bot-line-args overlong-p top-return)
"Returns a 1-2 item list of returns for this rail"
(declare (vars (side str))
with-data)
;; return nil if the length is too long to bend
;; i.e. if the cut length is greater than 240 + first bend line
@ -205,28 +156,32 @@
#(sidekey-rail "top_lvl") #pitch
#top-B)
top-B top-AB
top-lines (pipe-bend-lines (#! top-line-args)))
top-lines (pipe-bend-lines-padded (#! top-line-args)))
(if (overlong-p top-lines)
(setq top-B 18
top-A (frac (- top-AB top-B)))
(setq top-A ""))
(setq top-lines (pipe-bend-lines (#! top-line-args)))
(setq top-lines (pipe-bend-lines-padded (#! top-line-args)))
(add-to-list 'ret
(pad
(append (list "SR"
number
level
(rail-sequence side)
(rail-ascend side)
"4"
top-A
(frac top-B)
(frac (- top-horiz (sidekey-rail "top_lvl")))
(frac (sidekey-rail "top_lvl"))
(frac top-return))
top-lines)))))
(append (#! '(("mark" "SR")
("stair_number" #number)
("level" #level)
("sequence" #(rail-sequence side))
("ascend" #(rail-ascend side))
("detail" "4")
("straight_pipe_length" #top-A)
("length_@_pitch" #(frac top-B))
("distance_to_break_centerline"
#(frac (- top-horiz (sidekey-rail "top_lvl"))))
("level-off" #(frac (sidekey-rail "top_lvl")))
("return" #(frac top-return))))
(mapcar 'list
'("line_1" "angle_1" "line_2" "angle_2"
"line_3" "angle_3" "line_4" "angle_4"
"cut_length")
top-lines)))))
;; bot
(if (and (wcmatch (sidekey-rail "type") "*Stair*")
@ -262,44 +217,54 @@
(not top-dloop-p)
(> bot-AB 50))
18 bot-AB)
bot-lines (pipe-bend-lines (#! bot-line-args)))
bot-lines (pipe-bend-lines-padded (#! bot-line-args)))
(if (overlong-p bot-lines)
(setq bot-B (/ bot-AB 2.0)
bot-lines (pipe-bend-lines (#! bot-line-args))))
bot-lines (pipe-bend-lines-padded (#! bot-line-args))))
(if (= bot-B bot-AB)
(setq bot-A "")
(setq bot-A (frac (- bot-AB bot-B))))
(add-to-list 'ret
(pad
(append (list "SR"
number
level
(rail-sequence side)
(rail-ascend side)
bot-detail
bot-A
(frac bot-B)
(frac (- bot-horiz 0.75 (if (= bot-detail "3") 15 0)))
(if lvl-p (frac (sidekey-rail "bot_lvl")) "")
(frac bot-horiz))
bot-lines)))))
(append (#! '(("mark" "SR")
("stair_number" #number)
("level" #level)
("sequence" #(rail-sequence side))
("ascend" #(rail-ascend side))
("detail" #bot-detail)
("straight_pipe_length" #bot-A)
("length_@_pitch" #(frac bot-B))
("distance_to_break_centerline"
#(frac (- bot-horiz 0.75 (if (= bot-detail "3") 15 0))))
("level-off" #(if lvl-p (frac (sidekey-rail "bot_lvl")) ""))
("return" #(frac bot-horiz))))
(mapcar 'list
'("line_1" "angle_1" "line_2" "angle_2"
"line_3" "angle_3" "line_4" "angle_4"
"cut_length")
bot-lines)))))
(mapcar '(lambda(x) (cons finish x)) ret))
(defun-r 'calc-stair-rail-dloop)
(defun calc-stair-rail-dloops (stairs / dloops)
(defun-q calc-stair-rail-dloops (stairs / dloops)
"Returns a list of D-loops"
(foreach stair stairs
(with-data stair
'((append! 'dloops (calc-stair-rail-dloop "i"))
(append! 'dloops (calc-stair-rail-dloop "o"))))))
(defun-r 'calc-stair-rail-dloops)
(defun combine-stair-rail-dloops (d-loops / finish rail-map)
(defun-q combine-stair-rail-dloops (d-loops / finish rail-map)
"Returns D-LOOPS combined based on finish"
(foreach d d-loops
(setq finish (pop! 'd))
(add-to-alist 'rail-map finish (list d) T))
rail-map)
(defun-r 'combine-stair-rail-dloops)
(defun make-stair-rail-dloop-fabs (stairs / d-loops i finish loops)
(defun-q make-stair-rail-dloop-fabs (stairs / d-loops i finish loops)
"Calls %combine-stair-rail-dloops and makes D-loop drawings"
(setq d-loops (combine-stair-rail-dloops (calc-stair-rail-dloops stairs))
i 0)
(foreach map d-loops
@ -309,17 +274,11 @@
(debug-print '("Making D-loop fab " #(inc! 'i)))
(make-rail-fab-common "stair-rail-dloop"
'(stair-rail-dloop-write-table finish (take! 47 'loops))))))
(defun-r 'make-stair-rail-dloop-fabs)
(defun stair-rail-dloop-write-table (finish d-loop-datas
/ row)
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
(setq table (get-table-by-title "Stair Rail Bent Handrails")
row 3)
(vla-put-RegenerateTableSuppressed table :vlax-true)
(table-insert-rows table (length d-loop-datas) 3)
(foreach data d-loop-datas
(foreach col (range 0 20 1)
(vla-SetText table row col (to-string (nth col data))))
(inc! 'row))
(vla-put-RegenerateTableSuppressed table :vlax-false))
(defun-q stair-rail-dloop-write-table (finish d-loop-datas
/ row)
"Writes the D-loop table"
(set-finish finish)
(table-add-data (get-table-by-title "Stair Rail Bent Handrails") d-loop-datas))
(defun-r 'stair-rail-dloop-write-table)

@ -2,9 +2,9 @@
Here be dragons. This file is a mess.")
(defun-q stair-fab-process-stringers (/ ins stringer-material caps row l-string-bot-pts
(defun-q stair-fab-process-stringers (/ ins stringer-material caps l-string-bot-pts
l-string-mid-pts l-string-top-pts r-string-bot-pts
r-string-mid-pts r-string-top-pts f qty)
r-string-mid-pts r-string-top-pts)
"Adds both stringer details to drawing and their material to the table"
(declare (vars (dimspace nil (numberp dimspace))
(dwg-height nil (numberp dwg-height))
@ -21,20 +21,19 @@ Here be dragons. This file is a mess.")
(setq ins (displace-pt ins (list 0 (- (* dimspace 8)) 0)))
(fab-stringer--add-detail ins "r" piece-mark)))
(setq next-part-detail (displace-pt ins (list 0 (- (+ (* 3 dimspace) 70)) 0)))
;; add cap material to stringer material and put them in the table
(fab-stringer--add-cap-material caps)
(table-insert-rows mat-table (1+ (length stringer-material)) (1- (vla-get-Rows mat-table)))
(setq row 1)
(foreach s stringer-material
;; figure out quantities
(setq f (macro-expand '(lambda(x)
(if (= (cadr x) #(xd-value "mark" s)) 1 0)))
qty (apply '+ (mapcar f marks)))
(if (= stringers_eq "1")
(setq qty (* 2 qty)))
(add-to-list 's (list "qty" (to-string qty)))
(mat-table-set-row mat-table (inc! 'row) s)))
(mapcar!
'(lambda(s / f qty)
;; figure out quantities
(setq f (macro-expand '(lambda(x)
(if (= (cadr x) #(xd-value "mark" s)) 1 0)))
qty (apply '+ (mapcar f marks)))
(if (= stringers_eq "1")
(setq qty (* 2 qty)))
(add-to-list 's (list "qty" (to-string qty))))
'stringer-material)
(table-add-data mat-table stringer-material))
(defun-r 'stair-fab-process-stringers)
(defun-q fab-stringer--add-cap-material (caps / cap-marks tmp cap-slot)
@ -66,8 +65,7 @@ Here be dragons. This file is a mess.")
(list "qty" (length (cdr cap)))
(list "desc" "PLATE 1/4")
(list "width" (frac (caar cap)))
(list "length" (frac (cadar cap)))
(list "weight" (calc-weight-formula "PLATE 1/4"))))
(list "length" (frac (cadar cap)))))
(inc! 'current-mark-no)))
(defun-r 'fab-stringer--add-cap-material)
@ -393,6 +391,5 @@ Adds material to STRINGER-MATERIAL and cap material to CAPS"
(add-to-list 'stringer-material
(list (list "mark" seg-mark)
(list "desc" mat)
(list "length" (rtos len 2 2))
(list "weight" (calc-weight-formula mat))))))
(list "length" (rtos len 2 2))))))
(defun-r 'fab-stringer--add-segment-material)

@ -132,8 +132,7 @@ Essentially a composition of %make-generic-fab and %stair-fab--combine"
((begins-with tread_style "6") "GT "))
"Stair "
(to-string tread_qty)
"T"))
(vla-SetCellState ass-table 0 0 acCellStateContentLocked))
"T")))
(defun-r 'make-stair-fab)
(defun-q stair-fab--process-connections (/ material hardware tmp)
@ -162,10 +161,9 @@ Essentially a composition of %make-generic-fab and %stair-fab--combine"
(setq mark (strcat piece-mark (to-string (inc! 'current-mark-no))))
(foreach id (xd-value "id" x)
(add-to-list 'marks (list id mark)))
(add-to-list 'x (list "mark" mark))
(add-to-list 'x (list "weight" (calc-weight-formula (xd-value "desc" x)))))
(add-to-list 'x (list "mark" mark)))
'material)
(mat-table-add-data 'end material)
(table-add-data mat-table (cons nil material))
;; draw part details
(foreach m material
(if (setq tmp (xd-value "detail" m))
@ -175,18 +173,10 @@ Essentially a composition of %make-generic-fab and %stair-fab--combine"
(insert-block modelspace next-part-detail d)
(setq next-part-detail (displace-pt next-part-detail '(0 -70 0))))))
(if hardware
(progn
(setq hardware (combine-like-data hardware '("desc" "note") nil))
(table-insert-rows hdw-table
(length hardware)
(vla-get-Rows hdw-table))
(setq row 2)
(foreach h hardware
(hdw-table-set-row hdw-table row h)
(inc! 'row)))))
(table-add-data hdw-table (combine-like-data hardware '("desc" "note") nil))))
(defun-r 'stair-fab--process-connections)
(defun-q stair-fab--process-pans ( / pan-slots pans qtys row desc)
(defun-q stair-fab--process-pans ( / pan-slots pans)
"Adds pans to material list and draws their details"
;; draw pans details
(setq pan-slots (list (list (- (* 10 dimspace)) dimspace 0)
@ -198,16 +188,14 @@ Essentially a composition of %make-generic-fab and %stair-fab--combine"
pan-slots (mapcar '(lambda(x) (displace-pt x (list dwg-width 54 0))) pan-slots)
pans (mapcar 'process-pan-def
(vl-sort (calc-stair-pans)
(sort-by-key "mat" sort-strings-asc))))
(setq row (vla-get-Rows mat-table))
(table-insert-rows mat-table (1+ (length pans)) (1- row))
(foreach pan (vl-sort pans (sort-by-key "num"
(lambda (a b) (< (atoi (substr a 2))
(atoi (substr b 2))))))
(sort-by-key "mat" sort-strings-asc)))
pans (vl-sort pans (sort-by-key "num"
(lambda (a b) (< (atoi a)
(atoi b))))))
(table-add-data mat-table (cons nil pans))
(foreach pan pans
(if (not (member (xd-value "sty" pan) '("v" "h")))
(draw-pan-detail (pop! 'pan-slots) pan))
(mat-table-set-row mat-table row pan)
(inc! 'row)))
(draw-pan-detail (pop! 'pan-slots) pan))))
(defun-r 'stair-fab--process-pans)
(defun-q stair-fab--draw-square-detail ( / blockObj text-size halftread pitch-ins)
@ -594,18 +582,15 @@ This only adds the main segment and any haunches resulting from stringer extensi
(xd-value (strcat side "-string-top") marks))))
(defun-r 'stair-fab--main-view-add-stringer-callouts)
(defun-q stair-fab--process-stn (/ add-stn)
(defun-q stair-fab--process-stn (/ stn-mat skus add-len stns qtys)
"Adds STN to material list"
(defun add-stn (def qty row / desc)
(defun stn-mat (def qty / desc)
(setq desc (get-stn-desc-by-sku (cadr def)))
(mat-table-set-row mat-table
row
(list (list "mark" (strcat "STN" (car def)))
(list "qty" (to-string qty))
(list "desc" desc)
(list "length" (frac (distof (caddr def))))
(list "weight" (calc-weight-formula desc))
(list "note" (if (begins-with tread_style "1") "SL" "")))))
(list (list "mark" (strcat "STN" (car def)))
(list "qty" (to-string qty))
(list "desc" desc)
(list "length" (frac (distof (caddr def))))
(list "note" (if (begins-with tread_style "1") "SL" ""))))
(setq skus (list stn_tb_sku)
add-len (macro-expand '(lambda(x) (list x #(- btwn_stringers 0.125)))))
@ -615,17 +600,13 @@ This only adds the main segment and any haunches resulting from stringer extensi
(mapcar! add-len 'skus)
(setq stns (mapcar 'process-generic-def
skus
(lst* (strcat (xd-value "dir" job-info) "/stn.csv") (length skus))))
(setq row (1- (vla-get-Rows mat-table)))
(table-insert-rows mat-table (length stns) row)
(add-stn (car stns)
(if (or (= stn_tb_only "1")
(cdr stns))
2
rise_qty)
row)
(if (cdr stns)
(add-stn (cadr stns) (- rise_qty 2) (1+ row))))
(lst* (strcat (xd-value "dir" job-info) "/stn.csv") (length skus)))
qtys (list (if (or (= stn_tb_only "1")
(cdr stns))
2
rise_qty)
(- rise_qty 2)))
(table-add-data mat-table (mapcar 'stn-mat stns qtys)))
(defun-r 'stair-fab--process-stn)
(defun-q stair-fab--process-qt (stair-block / counts filename takeoff)
@ -637,19 +618,16 @@ This only adds the main segment and any haunches resulting from stringer extensi
takeoff (uniquify takeoff)
takeoff (mapcar 'process-generic-def
takeoff
(lst* filename (length takeoff))))
(setq row (1- (vla-get-Rows mat-table)))
(table-insert-rows mat-table (length takeoff) row)
(foreach q (vl-sort takeoff '(lambda(a b) (< (car a) (car b))))
(mat-table-set-row mat-table
row
(list (list "mark" (strcat "QT" (car q)))
(list "qty" (xd-value (mapcar 'distof (cdr q)) counts))
(list "desc" "QUIET TREAD 1/8")
(list "width" (frac (distof (cadr q))))
(list "length" (frac (distof (caddr q))))
(list "weight" (calc-weight-formula "QUIET TREAD 1/8"))))
(inc! 'row)))
(lst* filename (length takeoff)))
takeoff (vl-sort takeoff '(lambda(a b) (< (car a) (car b))))
takeoff (mapcar '(lambda(q)
(list (list "mark" (strcat "QT" (car q)))
(list "qty" (xd-value (mapcar 'distof (cdr q)) counts))
(list "desc" "QUIET TREAD 1/8")
(list "width" (frac (distof (cadr q))))
(list "length" (frac (distof (caddr q))))))
takeoff))
(table-add-data mat-table takeoff))
(defun-r 'stair-fab--process-qt)
(defun-q stair-fab--draw-top-view (ins / clayer blockObj)

@ -106,7 +106,9 @@
(make-closure-plate-fabs stairs)))
(if land-sl-p
(progn
(make-land-sl-fabs lands)))
(land-sl-make-fabs lands "hanger")
(land-sl-make-fabs lands "ledger")
(land-sl-make-fabs lands "post")))
(if lands-p
(progn
(make-land-fabs lands)))
@ -219,7 +221,7 @@ DATA is the data list of properties and ENT-TYPE is either 'stair or 'land."
;; set up assembly table rows
(table-insert-rows ass-table
(length assemblies)
(vla-get-Rows ass-table))
(1- (vla-get-Rows ass-table)))
(setq row 2)
(foreach assembly assemblies
@ -230,7 +232,7 @@ DATA is the data list of properties and ENT-TYPE is either 'stair or 'land."
(inc! 'row))
;; update finish table
(tk '(vla-SetText (get-table-by-title "Finish") 1 0 finish))
(set-finish (xd-value "finish" data))
;; call type-specific function
(setq piece-mark (next-mark-prefix)
@ -256,8 +258,8 @@ DATA is the data list of properties and ENT-TYPE is either 'stair or 'land."
(catch-all-error attempt)))))))))
;; multiply quantities
(table-multiply-qty mat-table 1 (length assemblies))
(table-multiply-qty hdw-table 0 (length assemblies))
(table-multiply-qty mat-table (length assemblies))
(table-multiply-qty hdw-table (length assemblies))
;; insert comment
;; include comments for custom connections
@ -366,55 +368,11 @@ Similarity is based on equivalence of the values of all keys in KEYS."
data-lists))
(defun-r 'fab-combine-like-data)
(defun-q calc-weight-formula (description / line wt wt-type)
"Returns the weight formula for a material description"
(declare (vars (description str)))
(setq line (assoc description (read-csv "fab/material.csv")))
(if (not line) (error (strcat "Weight formula not found: " description)))
(setq wt (nth 1 line)
wt-type (nth 2 line))
(cond ((= wt-type "sqft")
(strcat "=(B#*D#*E#/144)*" wt))
((= wt-type "foot")
(strcat "=(B#*E#/12)*" wt))
((= wt-type "each")
(strcat "=B#*" wt))))
(defun-r 'calc-weight-formula)
(defun-q next-mark-prefix (/ job-dir filename file mark ret increment-mark )
(defun-q next-mark-prefix (/ job-dir filename file mark ret)
"Returns the next available mark prefix and increments it"
(if (not (setq job-dir (find-job-dir)))
(error "Attempted to get next mark prefix while not in a job folder"))
;; internal function to actually calc next mark prefix
(defun increment-mark (mark /
glyphs
i
carry
ret
)
(setq glyphs (vl-string->list "ABCDEFGHJKLMNQRSTWXYZ")
mark (reverse (vl-string->list mark))
carry T)
(while (and carry mark)
(setq i (vl-position (car mark) glyphs))
(add-to-list 'ret
(if (= i (1- (length glyphs)))
(progn
(setq carry T)
(car glyphs))
(progn
(setq carry nil)
(nth (1+ i) glyphs))))
(setq mark (cdr mark)))
(cond (mark
(setq ret (append ret mark)))
(carry
(setq ret (cons (ascii "A") ret))))
(vl-list->string (reverse ret)))
(setq filename (strcat job-dir "/markprefix.txt"))
;; create file if not present
@ -473,3 +431,116 @@ closes the drawing."
(if (not *dev-mode*) (vla-Close acadDoc))
(reset-doc))
(defun-r 'make-rail-fab-common)
(defun-q set-finish (value / table)
"Sets the finish in the finish table to VALUE
Returns VALUE if successful or nil if no finish table found"
(declare (vars (value str)))
(setq table (get-table-by-title "Finish"))
(if table (vla-SetText table 1 0 value)))
(defun-r 'set-finish)
(defun-q get-finish (/ table)
"Returns the finish from the finish table or nil if no finish table found"
(setq table (get-table-by-title "Finish"))
(if table (vla-GetText table 1 0)))
(defun-r 'get-finish)
(defun-q get-material (/
matlst
;; 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
;; variables included here for scope,
;; but not defined here directly
extra-keys
tile-actions
)
"Prompts the user to choose a material description via dialog and returns it"
(setq matlst (read-csv "fab/material.csv")
toggle-keys '("show_all")
default-actions '(("category" . update-material)
("show_all" . update-material))
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 list box
(defun update-material (k v / )
(dialog-popup-list-update "material"))
(xd-value "material" (dialog-init "fab/material.dcl" "material" nil)))
(defun-r 'get-material)
(defun-q get-hardware (/
;; 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
;; variables included here for scope,
;; but not defined here directly
extra-keys
tile-actions
)
"Prompts the user to choose a hardware description via dialog and returns it"
(setq hdwlst (read-csv "fab/hardware.csv")
toggle-keys '("show_all")
default-actions '(("category" . update-hardware)
("show_all" . update-hardware))
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 (k v / )
(dialog-popup-list-update "hardware"))
(xd-value "hardware" (dialog-init "fab/hardware.dcl" "hardware" nil)))
(defun-r 'get-hardware)
(defun-q hardware-galv-desc (desc)
"Returns a hardware description that accounts for galvanization"
(declare (vars (desc str)))
(cond ((wcmatch desc "*WEDGE ANCHOR*")
(vl-string-subst "WEDGE ANCHOR SS304" "WEDGE ANCHOR" desc))
((wcmatch desc "*SCREW ANCHOR*")
(vl-string-subst "CRC SCREW ANCHOR" "SCREW ANCHOR" desc))
(T
(strcat "GALVANIZED " desc))))
(defun-r 'hardware-galv-desc)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,18 +1,16 @@
;; functions for wall rail fabs
(set-file-docstring "Functions for wall rail fabs")
(psc-include '("rail/util.lsp"))
;; return a list of wall rail definitions
(defun calc-wall-rail-fab (stair-data / calc ip op ret)
(defun-q calc-wall-rail-fab (stair-data / calc ip op ret)
"Return a list of wall rail definitions"
(defun calc (side other-p
/ ab lvl-p cut-len splice-p header brackets
bend-line-cut-length odd-brackets-p top-ab bot-ab subst-seq)
bend-line-cut-length odd-brackets-p top-ab bot-ab subst-seq bracket-cols)
;; return the header with suffix concatenated to the end of the sequence
(defun subst-seq (header suffix / ret)
(repeat 3 (add-to-list 'ret (pop! 'header)))
(add-to-list 'ret (strcat (pop! 'header) suffix))
(append ret header))
(subst-key "sequence" (strcat (xd-value "sequence" header) suffix) header))
(if (and (= (sidekey-rail "top_dloop") "0")
(= (sidekey-rail "bot_dloop") "0"))
@ -21,14 +19,16 @@
lvl-p (= rail_lvl-off "1")
cut-len (+ ab (if lvl-p 54 37))
splice-p (> cut-len 220)
header (list "WR"
number
level
(rail-sequence side)
(rail-ascend side)
(rtos pitch 2 2)
ab)
brackets (wall-rail-brackets ab))
header (#! '(("mark" "WR")
("stair_number" #number)
("level" #level)
("sequence" #(rail-sequence side))
("ascend" #(rail-ascend side))
("pitch" #(rtos pitch 2 2))
("length_at_pitch" #ab)))
brackets (wall-rail-brackets ab)
bracket-cols '("bracket_1" "bracket_2" "bracket_3" "bracket_4"
"bracket_5" "bracket_6" "bracket_7"))
(if splice-p
(progn
;; return cut length as float
@ -41,21 +41,27 @@
(list
(cons (list "wall-rail-top" finish)
(append (subst-seq header "-1")
(list (ceil (cut-len (#! '(7 90 15.4375 #pitch #top-ab)))))
(take (+ (/ (length brackets) 2)
(if odd-brackets-p 1 0))
brackets)))
(list
(list "cut_length"
(ceil (cut-len (#! '(7 90 15.4375 #pitch #top-ab))))))
(mapcar 'list bracket-cols
(take (+ (/ (length brackets) 2)
(if odd-brackets-p 1 0))
brackets))))
(cons (list (strcat "wall-rail-bot-" (if lvl-p "lvl" "std")) finish)
(append (subst-seq header "-2")
(list (ceil (cut-len (#! (if lvl-p
'(7 90 15.4375 #pitch #bot-ab)
'(7 90 #bot-ab))))))
(take (/ (length brackets) 2) brackets)))))
(list
(list "cut_length"
(ceil (cut-len (#! (if lvl-p
'(7 90 15.4375 #pitch #bot-ab)
'(7 90 #bot-ab)))))))
(mapcar 'list bracket-cols
(take (/ (length brackets) 2) brackets))))))
(list
(cons (list (strcat "wall-rail-" (if lvl-p "lvl" "std")) finish)
(append header
(list cut-len)
brackets)))))))
(list (list "cut_length" cut-len))
(mapcar 'list bracket-cols brackets))))))))
(with-data stair-data
'((setq stairno number
ip (= i-rail_type "Wall Rail")
@ -63,57 +69,38 @@
(if ip (add-to-list 'ret (calc "i" op)))
(if op (add-to-list 'ret (calc "o" ip)))
(apply 'append ret))))
(defun-r 'calc-wall-rail-fab)
;; combine rail-datas based on template+finish (spreadsheet rails) or
;; do a full combine for custom rails having D-loops
(defun combine-wall-rail-fabs (rail-datas
/ key keys rail-map stairno)
(defun-q combine-wall-rail-fabs (rail-datas
/ key rail-map stairno)
"Combine rail-datas based on template and finish"
(foreach rail rail-datas
(setq key (pop! 'rail))
(if (not (member key keys))
(add-to-list 'keys key))
(add-to-alist 'rail-map key (list rail) T))
rail-map)
(defun-r 'combine-wall-rail-fabs)
;; bundle rails and call make-wall-rail-fab
(defun make-wall-rail-fabs (stairs / rail-datas template finish rails)
(defun-q make-wall-rail-fabs (stairs / rail-datas template finish rails)
"Bundle rails and call make-wall-rail-fab"
(setq rail-datas (combine-wall-rail-fabs (map-append 'calc-wall-rail-fab stairs)))
(foreach rails rail-datas
(setq template (caar rails)
finish (cadar rails)
rails (cdr rails))
(while rails
(make-wall-rail-std-fab template finish (take! 60 'rails)))))
(make-wall-rail-std-fab template finish (take! 60 'rails)))))
(defun-r 'make-wall-rail-fabs)
;; open template and write table
(defun make-wall-rail-std-fab (template finish rails)
(defun-q make-wall-rail-std-fab (template finish rails)
"Open template and call %wall-rail-write-table"
(debug-print '("Making wall rail fab: " #template))
(make-rail-fab-common template '(wall-rail-write-table finish rails)))
(defun-r 'make-wall-rail-std-fab)
;; write the table in a wall rail fab drawing
(defun wall-rail-write-table (finish rail-datas / rail-table hdw-table)
(vla-SetText (get-table-by-title "Finish") 1 0 finish)
(setq rail-table (get-table-by-title "Wall Rails")
hdw-table (get-table-by-title "Bracket Hardware")
row 2)
(vla-put-RegenerateTableSuppressed rail-table :vlax-true)
(vla-put-RegenerateTableSuppressed hdw-table :vlax-true)
(table-insert-rows rail-table (length rail-datas) 3)
(table-insert-rows hdw-table (1+ (length rail-datas)) 3)
(vla-SetText hdw-table (1- (vla-get-Rows hdw-table)) 0
(strcat "=SUM(A3:A" (to-string (+ 3 (length rail-datas))) ")"))
(vla-SetText hdw-table (1- (vla-get-Rows hdw-table)) 1
(strcat "=SUM(B3:B" (to-string (+ 3 (length rail-datas))) ")"))
(foreach rail rail-datas
(setq col -1)
(inc! 'row)
(foreach x rail
(vla-SetText rail-table row (inc! 'col) (to-string x)))
(vla-SetText hdw-table row 0 "0")
(vla-SetText hdw-table row 1 "0"))
(vla-put-RegenerateTableSuppressed rail-table :vlax-false)
(vla-put-RegenerateTableSuppressed hdw-table :vlax-false)
(defun-q wall-rail-write-table (finish rail-datas / rail-table)
"Write the table in a wall rail fab drawing"
(set-finish finish)
(table-add-data (get-table-by-title "Wall Rails") rail-datas)
;; update "work with" note for splicers
(if (member template '("wall-rail-top" "wall-rail-bot-std" "wall-rail-bot-lvl"))
@ -125,3 +112,4 @@
(to-string ((if (= template "wall-rail-top") + -)
(atoi num) 1))))
(vla-replace-string modelSpace "$SPLICER_DWG" other-dwg)))))
(defun-r 'wall-rail-write-table)

@ -331,13 +331,14 @@ draw (relative to the view of the section)."
((lambda (/ obj)
(setq obj (add-polyline blockObj
'(0 0)
(list (list (+ gap 2) 0 0) (list (+ gap 2) 4 0))
(list (list (+ (cornerkey "gap") 2) 0 0)
(list (+ (cornerkey "gap") 2) 4 0))
nil))
(offset&close obj 0.3125 T '(0 1))
(vla-delete obj)
;; slot
(setq obj (add-polyline blockObj
(list (+ gap 2) 4)
(list (+ (cornerkey "gap") 2) 4)
(list (list -1.125 0 0) (list 1.125 0 0))
nil))
(offset&close obj 0.34375 T '(1 1))

@ -1,3 +1,5 @@
(set-file-docstring "")
;;; functions to draw guard rails
(psc-include
'( "shapes/line.lsp"

@ -49,10 +49,7 @@
(+ x-offset 1.5))
50))
rail_hgt_adj)
rail-len (if rail-top-ext (+ (- x-offset) bot_ext bot_cdist run -3.875 rail-top-ext 0))
rail-len (if (and rail-len (< top_ext (/ tread_depth 2.0)))
(+ rail-len top_ext)
rail-len)
rail-len (calc-stair-rail-opcl side)
top-mount (if (= "1" (sidekey-rail "topmnt")) nosing-mid)
chop-top (if rail-cutoff (- flight_hgt rail-cutoff y-offset))
args (list pitch

@ -1,5 +1,18 @@
(set-file-docstring "Common functions for rail calculations")
(defun-q calc-stair-rail-opcl (side)
"Returns the outer post centerline length of a stair rail"
(declare with-data)
(+ (- run 6.25)
(- bot_cdist 1.25)
(- top_cdist 1.25)
(if (wcmatch bot_conn "*haunch*")
(min tread_depth bot_ext)
bot_ext)
(sidekey-rail "top_ext")
(sidekey-rail "bot_ext")))
(defun-r 'calc-stair-rail-opcl)
(defun-q rail-calc-n-mid-posts (len / n)
"Returns the number of mid posts based on outside post centerline

@ -957,3 +957,11 @@ If there is, and ADD-P is non-nil, adds it to blockObj"
(1 6 0))
(xd-value "bot-haunch-l-btwn" marks)))
(defun-r 'bot-chkr-haunch-top)
(defun-q tc-bolt-desc (desc)
"Returns the proper TC bolt description, taking into account finish"
(declare (vars (desc str)))
(strcat (if (= finish "Galvanized") "GALVANIZED " "")
"T.C. BOLT (A325) "
desc))
(defun-r 'tc-bolt-desc)

@ -260,7 +260,7 @@
;;hardware
(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw)))
("desc" #(tc-bolt-desc top_hdw)))
))))
(defun material-140 () (material-x40 2))
@ -345,8 +345,8 @@
;; hardware
(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " bot_hdw))
)))))
("desc" #(tc-bolt-desc bot_hdw)))
))))
(defun material-141 () (material-x41 2))
(defun material-161 () (material-x41 4))
@ -442,7 +442,7 @@
;; hardware
(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw))
("desc" #(tc-bolt-desc top_hdw))
)))))
(defun material-142 () (material-x42 2))
@ -545,7 +545,7 @@
)))
(#! '(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw)))
("desc" #(tc-bolt-desc top_hdw)))
))))
(defun material-144 () (material-x44 2))
@ -648,7 +648,7 @@
)))
(#! '(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " bot_hdw)))
("desc" #(tc-bolt-desc bot_hdw)))
))))
(defun material-145 () (material-x45 2))

@ -71,7 +71,7 @@
;; hardware
(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw)))
("desc" #(tc-bolt-desc top_hdw)))
))))
(defun material-120 () (material-x20 2))
@ -184,7 +184,7 @@
;; hardware
(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " bot_hdw))
("desc" #(tc-bolt-desc bot_hdw))
("note" "SL"))
))))
@ -297,7 +297,7 @@
;; hardware
(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw))
("desc" #(tc-bolt-desc top_hdw))
("note" "SL"))
))))
@ -412,7 +412,7 @@
(top-conc-haunch-material))
(#! '(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw))
("desc" #(tc-bolt-desc top_hdw))
("note" "SL"))
))))
@ -479,7 +479,7 @@
)))
(#! '(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " top_hdw))
("desc" #(tc-bolt-desc top_hdw))
("note" "SL"))
))))
@ -555,7 +555,7 @@
(bot-conc-haunch-material))
(#! '(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " bot_hdw))
("desc" #(tc-bolt-desc bot_hdw))
("note" "SL"))
))))
@ -620,7 +620,7 @@
)))
(#! '(
(("qty" #bolt-qty)
("desc" #(strcat "T.C. BOLT (A325) " bot_hdw))
("desc" #(tc-bolt-desc bot_hdw))
("note" "SL"))
))))
@ -708,7 +708,7 @@
)
(
(("qty" 2)
("desc" #(strcat "T.C. BOLT (A325) " bot_hdw))
("desc" #(tc-bolt-desc bot_hdw))
("note" "SL"))
))))

@ -192,9 +192,6 @@ Called by %add-stair-conc"
(defun add-desc (pan)
(cons (list "desc" (xd-value "mat" pan))
pan))
(defun add-weight (pan)
(cons (list "weight" (calc-weight-formula (xd-value "mat" pan)))
pan))
(defun add-pts (pan)
(cons (list "pts" (apply (read (strcat "calc-stair-pans--" (xd-value "sty" pan)))
(xd-value "def" pan)))
@ -211,7 +208,7 @@ Called by %add-stair-conc"
(cons (list "width" (calc-stair-pans--width pan)) pan))
(mapcar (compose
(if fab-p
'(add-weight add-width add-pts-x2 add-pts add-mat add-thk add-length)
'(add-width add-pts-x2 add-pts add-mat add-thk add-length)
'(add-pts add-thk)))
pans))
(defun-r 'calc-stair-pans--add-defaults)

@ -221,6 +221,9 @@
;;
((LAMBDA (/ ERRORS) (SETQ ERRORS ((LAMBDA (/ *ASSERT-RETURN-ERROR*) (SETQ *ASSERT-RETURN-ERROR* T) (ASSERT-ALL (QUOTE ((= (ESCAPE-NEWLINES "hi") "hi") (= (ESCAPE-NEWLINES "item1\nitem2") "item1\\nitem2"))))))) (IF ERRORS (PROGN (PRINC "\nTEST autotest-escape-newlines: declare autotest\n") (PRINC (STRJOIN ERRORS "\n")) (PRINC "\n") (SETQ N-ERRORS (+ N-ERRORS (LENGTH ERRORS)))))))
;;
((LAMBDA (/ ERRORS) (SETQ ERRORS ((LAMBDA (/ *ASSERT-RETURN-ERROR*) (SETQ *ASSERT-RETURN-ERROR* T) (ASSERT-ALL (QUOTE ((= (INCREMENT-MARK "A") "B") (= (INCREMENT-MARK "Z") "AA") (= (INCREMENT-MARK "ZZ") "AAA"))))))) (IF ERRORS (PROGN (PRINC "\nTEST autotest-increment-mark: declare autotest\n") (PRINC (STRJOIN ERRORS "\n")) (PRINC "\n") (SETQ N-ERRORS (+ N-ERRORS (LENGTH ERRORS)))))))
(psc-include (list "util/xdata.lsp"))
;;

@ -59,6 +59,7 @@ closed and %reset-doc is called after."
(defun-q osnap-on ()
"Restore object snaps in current acadDoc"
(setq *error* nil)
(vla-setvar 'osmode (logand (~ (expt 2 14))
(vla-getvar 'osmode))))
(defun-r 'osnap-on)

@ -83,7 +83,7 @@ WRAP-STR is non-nil, wrap each cell in a formula like =\"CELL-CONTENT\"."
(if (not file) (error (strcat "Cannot open " filename)))
(foreach line lines
(setq line (strjoin (mapcar '(lambda(s)
(setq s (string-subst-all "" "," s))
(setq s (string-subst-all "" "," (to-string s)))
(if wrap-str
(strcat "=\"" s "\"")
s))

@ -132,6 +132,17 @@ Each element to SEGMENTS-LST should be a string. Assumes 1.66OD pipe, centerline
ret))))))
(defun-r 'pipe-bend-lines)
(defun-q pipe-bend-lines-padded (segments-lst / cut-len)
"Wrapper for %pipe-bend-lines that always returns a 9-item list to match fab drawing tables"
(setq segments-lst (reverse (pipe-bend-lines segments-lst))
cut-len (pop! 'segments-lst))
(reverse
(cons cut-len
(?? (repeat (- 8 (length segments-lst))
(setq segments-lst (cons "" segments-lst)))
segments-lst))))
(defun-r 'pipe-bend-lines-padded)
(defun-q within-box-p (pt boxpt1 boxpt2 / ptx ptx b1x b1y b2x b2y lx rx ty by)
"Returns T if PT is within the box defined by BOXPT1 and BOXPT2"
(declare (vars (pt list (point-p pt))

@ -7,284 +7,513 @@ operations.")
(defun-q table-p (obj)
"Returns T if OBJ is a table"
(declare (vars (obj vla-object)))
(= "AcDbTable" (vla-get-ObjectName obj)))
(defun-r 'table-p)
(defun-q table-row-extents (table row / tl br tmp)
"Returns the extents of a row in TABLE
(defun-q material-table-p (table)
"Returns T if TABLE is a *Material table, i.e that its title %ends-with \"Material\""
(declare (vars (table vla-object (table-p table))))
(ends-with (table--get-title-maybe table) "Material"))
(defun-r 'material-table-p)
The return value is a 2-item list in the form '(top-left-pt bot-right-pt)."
(declare (vars (table vla-object (table-p table))
(row int)))
(setq tmp (vlax-safearray->list
(vlax-variant-value (vla-GetCellExtents table row 0 :vlax-false)))
tl (list (car tmp)
(cadr tmp)
(caddr tmp))
tmp (- (vla-get-Columns table) 1)
tmp (vlax-safearray->list
(vlax-variant-value (vla-GetCellExtents table row tmp :vlax-false))))
(repeat 3 (setq tmp (cdddr tmp)))
(setq br (list (car tmp)
(cadr tmp)
(caddr tmp)))
(list tl br))
(defun-r 'table-row-extents)
(defun-q get-all-tables (/ ret)
"Returns a list of all tables"
(vlax-for ent modelSpace
(if (= (vla-get-objectname ent) "AcDbTable")
(add-to-list 'ret (table--fix ent))))
ret)
(defun-r 'get-all-tables)
(defun-q get-table-by-title (title / ret)
"Returns the table with matching TITLE
TITLE is matched against cell A1 of all tables in the database using wcmatch, so any
wildcards wcmatch accepts will work here."
wildcards wcmatch accepts will work here.
Automatically calls %table--fix"
(declare (vars (title str)))
(setq title (lowercase title))
(vlax-for ent modelSpace
(if (and (= (vla-get-objectname ent) "AcDbTable")
(wcmatch (lowercase (vla-GetText ent 0 0)) title))
(setq ret ent)))
ret)
(wcmatch (vla-GetText ent 0 0) title))
(setq ret ent)))
(if ret
(table--fix ret)))
(defun-r 'get-table-by-title)
(defun-q table-get-row (table / pt row last-row ret)
"Prompts user for a point and checks if it is inside a row in TABLE
(defun-q table-get-title (table)
"Returns the contents of cell 0,0"
(declare (vars (table vla-object (table-p table))))
(vla-GetText table 0 0))
(defun-r 'table-get-title)
(defun-q table--get-title-maybe (table)
"If the symbol TITLE is defined, returns its value. Otherwise, calls %table-get-title"
(declare (vars (table vla-object (table-p table))))
(if title title (table-get-title table)))
(defun-r 'table--get-title-maybe)
(defun-q table-get-nrows (table)
"Returns the number of effective rows in TABLE
Effective rows includes the title, header, and body rows except for the weight summary row
in *Material tables."
(declare (vars (table vla-object (table-p table))))
((if (material-table-p table) 1- +) (vla-get-Rows table)))
(defun-r 'table-get-nrows)
(defun-q table--body-rows (table)
"Returns a list of body (not title or header) row indices in TABLE"
(declare (vars (table vla-object (table-p table))))
(range (1+ (if header-row header-row (table--get-header-row table)))
(- (vla-get-Rows table)
(if (ends-with (table--get-title-maybe table) "Material") 1 0))
1))
(defun-r 'table--body-rows)
If so, it returns the index of that row."
(defun-q table--cells (table / rows cols ret)
"Returns a list of cells in TABLE as 2-item lists of the form (row col)"
(declare (vars (table vla-object (table-p table))))
(foreach row (range 0 (vla-get-Rows table) 1)
(foreach col (range 0 (vla-get-Columns table) 1)
(add-to-list 'ret (list row col)))))
(defun-r 'table--cells)
(defun-q get-table-cell (/ pt table)
"Prompts user for a point and checks if it is inside in a table
If so, it returns a list of the form (table row column)."
(osnap-off)
(setq pt (getpoint "\nSelect table row: ")
row 1
last-row (vla-get-Rows table))
(if (= (vla-GetText table 0 0) "Material") (dec! 'last-row))
(setq pt (getpoint "\nSelect table cell: ")
table (car
(strip-nil
(mapcar '(lambda(table) (if (table--pt-in-table-p pt table) table))
(get-all-tables)))))
(osnap-on)
(while (< (setq row (1+ row)) last-row)
(if (apply 'within-box-p (cons pt (table-row-extents table row)))
(setq ret row)))
ret)
(defun-r 'table-get-row)
(if table
(car
(strip-nil
(mapcar
'(lambda(cell / row col)
(setq row (car cell)
col (cadr cell))
(if (apply 'within-box-p (cons pt (get-table-cell--bounding-box table row col)))
(cons table cell)))
(table--cells table))))))
(defun-r 'get-table-cell)
(defun-q table--pt-in-table-p (pt table / minpt maxpt min-x max-x min-y max-y x y)
"Returns T if PT is within TABLE's bounding box"
(declare (vars (pt list (point-p pt))
(table vla-object (table-p table))))
(vla-GetBoundingBox table 'minpt 'maxpt)
(within-box-p pt (vlax-safearray->list minpt) (vlax-safearray->list maxpt)))
(defun-r 'table--pt-in-table-p)
(defun-q get-table-cell--bounding-box (table row col / extents)
"Returns the bounding box for the cell as a list of the form (minpt maxpt)"
(declare (vars (table vla-object (table-p table))
(row int)
(col int)))
(setq extents (3-item-list
(vlax-safearray->list
(vlax-variant-value
(vla-GetCellExtents table row col :vlax-false)))))
(list (nth 2 extents) (nth 1 extents)))
(defun-r 'get-table-cell--bounding-box)
(defun-q table--format-column-name (name)
"Returns NAME as lowercase with spaces replaced by underscores"
(declare (vars (name str)))
(string-subst-all "_" " " (lowercase name)))
(defun-r 'table--format-column-name)
(defun-q table--empty-first-column-p (table row)
"Returns T if column 0 of ROW is empty"
(declare (vars (table vla-object (table-p table))
(row int)))
(= (vla-GetText table row 0) ""))
(defun-r 'table--empty-first-column-p)
(defun-q table--get-header-row (table)
"Returns the index of the row containing the column headers"
(declare (vars (table vla-object (table-p table))))
(if (table--empty-first-column-p table 1) 2 1))
(defun-r 'table--get-header-row)
(defun-q table-insert-rows (table nrows before / title rowht tables2move lastrow)
"Inserts NROWS rows in a fab drawing TABLE before row BEFORE
(defun-q table-get-column-names (table / header-row)
"Returns the column names as a list of formatted strings
If there are other fab tables below this one, move them down to accomodate."
Strings are formatted by %table--format-column-name"
(declare (vars (table vla-object (table-p table))))
(setq header-row (table--get-header-row table))
(mapcar '(lambda(col) (table--format-column-name (vla-GetText table header-row col)))
(range 0 (vla-get-Columns table) 1)))
(defun-r 'table-get-column-names)
(defun-q table--get-column-names-maybe (table)
"If the symbol 'col-names is defined, returns its value. Otherwise, calls %table-get-column-names"
(declare (vars (table vla-object (table-p table))))
(if col-names col-names (table-get-column-names table)))
(defun-r 'table--get-column-names-maybe)
(defun-q table-insert-rows (table nrows after / title rowht)
"Inserts NROWS rows in a fab drawing TABLE after row AFTER
If this is a generic fab table there are other generic fab tables below this one, move
them down to accomodate. If this is the Assembly* table, update the quantities in Material
and Hardware tables, if found."
(declare (vars (table vla-object (table-p table))
(nrows int)
(before int)))
(after int)))
(setq rowht (vla-GetRowHeight table 0)
title (vla-GetText table 0 0))
(cond ((wcmatch title "Material")
(setq tbls2move '("Hardware"
"Assembly*"
"Finish")))
((wcmatch title "Hardware")
(setq tbls2move '("Assembly*"
"Finish")))
((wcmatch title "Assembly*")
(setq tbls2move '("Finish"))))
(mapcar! 'get-table-by-title 'tbls2move)
(foreach tbl (strip-nil tbls2move)
(vla-Move tbl
(vlax-3d-point 0 0 0)
(vlax-3d-point 0 (- (* rowht nrows)) 0)))
(vla-InsertRows table before rowht nrows))
title (table-get-title table))
(--shift-tables-maybe title (- (* rowht nrows)))
(vla-InsertRows table (1+ after) rowht nrows)
(if (begins-with title "Assembly")
(progn
(setq mt (get-table-by-title "Material")
ht (get-table-by-title "Hardware")
table-nrows (length (table--body-rows table)))
(if mt
(progn
(table-divide-qty mt (- table-nrows nrows))
(table-multiply-qty mt table-nrows)))
(if ht
(progn
(table-divide-qty ht (- table-nrows nrows))
(table-multiply-qty ht table-nrows)))))
(if (material-table-p table)
(progn
(mat-table--update-marks table + nrows (1+ after))
(mat-table--update-total-weight table))))
(defun-r 'table-insert-rows)
(defun-q mat-table-update-marks (+- n at / prefix row rows mark marks)
"Update fab mark numbers in material table and callouts
(defun-q table-trim-empty-rows (table row / title nrows mt ht table-nrows)
"Trims empty rows from TABLE, starting at ROW
+- should be one of the built-in functions + or -, indicating whether the mark numbers
should increase or decrease. N is the number of places the number should jump. AT is the
first row in the material table containing mark numbers to change.
Determines if row is empty using %table--empty-first-column-p"
(declare (vars (table vla-object (table-p table))
(row int)))
(setq title (table-get-title table)
table-nrows (table-get-nrows table)
nrows 0)
(while (and (< row table-nrows)
(table--empty-first-column-p table row))
(inc! 'row)
(inc! 'nrows))
(if (= title "Material")
(mat-table--update-marks table - nrows (- row nrows)))
(if (> nrows 0)
(vla-DeleteRows table (- row nrows) nrows))
(if (begins-with title "Assembly")
(progn
(setq mt (get-table-by-title "Material")
ht (get-table-by-title "Hardware"))
(if mt
(progn
(table-divide-qty mt (- table-nrows 2))
(table-multiply-qty mt (- table-nrows nrows 2))))
(if ht
(progn
(table-divide-qty ht (- table-nrows 2))
(table-multiply-qty ht (- table-nrows nrows 2))))))
(--shift-tables-maybe title (* (vla-GetRowHeight table 0) nrows)))
(defun-r 'table-trim-empty-rows)
Expects to be called by a function with TABLE set to the material table."
(declare (vars (+- subr (member +- (list + -)))
(n int)
(at int)
(table vla-object (table-p table))))
(defun new-mark (mark)
(strcat prefix
(to-string (+- (atoi (vl-string-left-trim prefix mark)) n))))
(setq prefix (vl-string-right-trim "0123456789" (vla-GetText table 2 0))
row at
rows (1- (vla-get-Rows table)))
(while (and (< row rows)
(or (begins-with (setq mark (vla-GetText table row 0)) prefix)
(= mark "")))
(if (/= mark "")
(progn
(add-to-list 'marks (list mark (new-mark mark)))
(vla-SetText table row 0 (new-mark mark))))
(inc! 'row))
(defun-q --shift-tables-maybe (title delta-y)
"If TITLE is one of the generic fab tables, call %--shift-tables"
(cond ((= title "Material")
(--shift-tables '("Hardware" "Assembly*" "Finish") delta-y))
((= title "Hardware")
(--shift-tables '("Assembly*" "Finish") delta-y))
((wcmatch title "Assembly*")
(--shift-tables '("Finish") delta-y))))
(defun-r '--shift-tables-maybe)
(mapcar '(lambda(x) (vla-replace-string modelSpace (car x) (cadr x)))
((if (= +- +) reverse identity) marks))
(vla-Regen acadDoc acAllViewPorts))
(defun-r 'mat-table-update-marks)
(defun-q --shift-tables (names delta-y)
"Move the tables named in NAMES vertically by DELTA-Y"
(declare (vars (names (list nil) (vl-every 'stringp names))
(delta-y nil (numberp delta-y))))
(foreach tbl (mapcar 'get-table-by-title names)
(vla-Move tbl (3dpt 0 0) (3dpt 0 delta-y))))
(defun-r '--shift-tables)
(defun-q mat-table-add-data (before datas / n row)
"Adds bulk data to material table
(defun-q table--column-name->letter (name / pos)
"Returns the letter designation of the column named NAME
BEFORE is the row to add data at. The special symbol 'end means the last row. DATAS is a
list of data lists representing row data."
(declare (vars (before nil (or (= before 'end)
(= (type before) 'int)))
(datas list (vl-every 'data-list-p datas))))
(if (= before 'end)
(setq before (1- (vla-get-Rows mat-table))))
(setq n (length datas)
row before)
(table-insert-rows mat-table n before)
(vla-put-RegenerateTableSuppressed mat-table :vlax-true)
(foreach data datas
(mat-table-set-row mat-table row data)
(inc! 'row))
(vla-put-RegenerateTableSuppressed mat-table :vlax-false))
(defun-r 'mat-table-add-data)
(defun-q mat-table-set-row (mat-table row data / cols row-ht last-row i)
"Sets a ROW in MAT-TABLE
ROW is a row index and DATA is a data list whose keys correspond to the table columns."
(declare (vars (mat-table vla-object (table-p mat-table))
(row int (>= row 0))
(data nil (data-list-p data))))
(setq row-ht (vla-GetRowHeight mat-table 0)
last-row (1- (vla-get-Rows mat-table))
cols '(mark qty desc width length weight note))
;; overwrite weight formula with correct row number
(subst! (list "weight" (string-subst-all (to-string (1+ row))
"#"
(cadr (assoc "weight" data))))
(assoc "weight" data)
'data)
;; unlock description and weight
(vla-SetCellState mat-table row 2 acCellStateNone)
(vla-SetCellState mat-table row 5 acCellStateNone)
;; write the row
(foreach col cols
(if (setq col (assoc (lowercase (to-string col)) data))
(vla-SetText mat-table
row
(vl-position (read (car col)) cols)
(cadr col))))
;; lock description and weight
(vla-SetCellState mat-table row 2 acCellStateContentLocked)
(vla-SetCellState mat-table row 5 acCellStateContentLocked)
;; ensure weight has correct format
(vla-SetCellFormat mat-table row 5 "%lu2%pr1")
;; reset row height in case it changed
(vla-SetRowHeight mat-table row row-ht)
(setq i 1)
(while (> (- (vla-GetRowHeight mat-table row) (* row-ht i)) 0.1)
(vla-SetRowHeight mat-table row (* row-ht (inc! 'i)))
(foreach table (mapcar 'get-table-by-title '("Hardware"
"Assembly*"
"Finish"))
(if table
(vla-Move table (3dpt 0 0) (3dpt 0 (- row-ht))))))
;; update weight sums
(vla-SetText mat-table last-row 4 (strcat "=sum(F3:F" (to-string last-row) ")"))
(mat-table-update-ea-wt mat-table))
(defun-r 'mat-table-set-row)
(defun-q mat-table-update-ea-wt (mat-table / at lastrow formula)
"Updates the formula for \"each weight\" in MAT-TABLE to include any added rows"
(declare (vars (mat-table vla-object (table-p mat-table))))
(setq at (get-table-by-title "Assembly*")
lastrow (1- (vla-get-Rows mat-table))
formula (strcat "=E"
(to-string (1+ lastrow))
"/"
(to-string (- (vla-get-Rows at) 2))))
(vla-SetCellFormat mat-table lastrow 6 "%lu2%pr1")
(vla-SetText mat-table lastrow 6 formula)
(vla-SetRowHeight mat-table lastrow row-ht))
(defun-r 'mat-table-update-ea-wt)
(defun-q table-multiply-qty (table qty-col n / i lastrow qty row-ht)
"Multiplies every quantity in TABLE by N
QTY-COL is the index of the quantities column."
Either 'col-names or 'table must be defined."
(declare (vars (name str)))
(setq pos (vl-position name (table--get-column-names-maybe table)))
(if (< pos 27)
(chr (vl-string-elt "ABCDEFGHIJKLMNOPQRSTUVWXYZ" pos))
((lambda(/ mark)
(setq mark "AA")
(repeat (- pos 27) (setq mark (increment-mark mark)))
mark))))
(defun-r 'table--column-name->letter)
(defun-q table-multiply-qty (table n / i lastrow qty row-ht)
"Multiplies every quantity in TABLE by N"
(declare (vars (table vla-object (table-p table))
(qty-col int (>= qty-col 0))
(n int)))
(setq i 1
lastrow (vla-get-Rows table))
(setq qty-col (vl-position "qty" (table--get-column-names-maybe table))
i 1
lastrow (table-get-nrows table))
(vla-put-RegenerateTableSuppressed table :vlax-true)
(while (< (inc! 'i) lastrow)
(setq qty (atoi (vla-GetText table i qty-col)))
(if (> qty 0) (vla-SetText table i qty-col (to-string (* qty n))))))
(setq qty (atoi (vla-GetText table i qty-col)))
(if (> qty 0) (vla-SetText table i qty-col (to-string (* qty n)))))
(vla-put-RegenerateTableSuppressed table :vlax-false))
(defun-r 'table-multiply-qty)
(defun-q table-divide-qty (table qty-col n / i lastrow qty)
"Divides every quantity in TABLE by N
QTY-COL is the index of the quantities column."
(defun-q table-divide-qty (table n / i lastrow qty)
"Divides every quantity in TABLE by N"
(declare (vars (table vla-object (table-p table))
(qty-col int (>= qty-col 0))
(n int)))
(setq i 1
lastrow (vla-get-Rows table))
(setq qty-col (vl-position "qty" (table--get-column-names-maybe table))
i 1
lastrow (table-get-nrows table))
(vla-put-RegenerateTableSuppressed table :vlax-true)
(while (< (inc! 'i) lastrow)
(setq qty (atoi (vla-GetText table i qty-col)))
(if (> qty 0) (vla-SetText table i qty-col (to-string (/ qty n))))))
(setq qty (atoi (vla-GetText table i qty-col)))
(if (> qty 0) (vla-SetText table i qty-col (to-string (/ qty n)))))
(vla-put-RegenerateTableSuppressed table :vlax-false))
(defun-r 'table-divide-qty)
(defun-q hdw-table-set-row (hdw-table row data / cols row-ht)
"Sets a ROW in HDW-TABLE
(defun-q table--fix-row-height (table row orig-ht / base-ht pre-ht post-ht ass-table)
"Constrains the row height to multiples of table base row height
ROW is a row index and DATA is a data list whose keys correspond to the table columns."
(declare (vars (hdw-table vla-object (table-p hdw-table))
(row int (>= row 0))
(data nil (data-list-p data))))
(setq row-ht (vla-GetRowHeight hdw-table 0)
cols '(qty desc note))
;; unlock description
(vla-SetCellState hdw-table row 1 acCellStateNone)
;; write the row
(foreach col cols
(if (setq col (assoc (lowercase (to-string col)) data))
(vla-SetText hdw-table
row
(vl-position (read (car col)) cols)
(cadr col))))
;; reset row height in case it changed
(vla-SetRowHeight hdw-table row row-ht)
;; lock description
(vla-SetCellState hdw-table row 1 acCellStateContentLocked))
(defun-r 'hdw-table-set-row)
;; write the cell data for the given row in the generic ship loose template
(defun-q gsl-mat-table-set-row (gsl-mat-table row data / cols row-ht)
"Sets a ROW in a generic ship loose template table
ROW is a row index and DATA is a data list whose keys correspond to the table columns."
(declare (vars (gsl-mat-table vla-object (table-p gsl-mat-table))
If ROW height has changed from ORIG-HT, calls %--shift-tables-maybe"
(declare (vars (table vla-object (table-p table))
(row int)
(orig-ht real)))
(setq i 1
base-ht (vla-GetRowHeight table 0)
pre-ht (vla-GetRowHeight table row))
(vla-SetRowHeight table row orig-ht)
(setq post-ht (vla-GetRowHeight table row)
weight (vla-gettext table row 5))
(while (> (- (vla-GetRowHeight table row) (* base-ht i)) 0.3)
(debug-print-vars '(row orig-ht base-ht pre-ht post-ht weight))
(vla-SetRowHeight table row (* orig-ht (inc! 'i)))
(--shift-tables-maybe (table-get-title table) (- orig-ht))))
(defun-r 'table--fix-row-height)
(defun-q table-set-row (table row data / title cols idx)
"Sets a ROW in TABLE
ROW is a row index and DATA is a data list whose keys correspond to the table columns. If TABLE is a material table, attempts to set the weight formula.
To add data in bulk with formula regeneration disabled to improve performance, see
%table-add-data"
(declare (vars (table vla-object (table-p table))
(row int (>= row 0))
(data nil (data-list-p data))))
(setq cols '(mark qty desc width length note))
(setq cols (table--get-column-names-maybe table)
idx 0
row-ht (vla-GetRowHeight table row)
title (table-get-title table))
(foreach col cols
(if (setq col (assoc (lowercase (to-string col)) data))
(vla-SetText gsl-mat-table
row
(+ 4 (vl-position (read (car col)) cols))
(cadr col)))))
(defun-r 'gsl-mat-table-set-row)
(defun-q parse-table (table / row last-row col last-col line ret)
"Returns the data in TABLE as a nested list of strings
Skips the first two rows (assumes they are headers) and any rows whose first column is
blank."
(if (setq col (xd-value col data))
(vla-SetText table row idx (to-string col)))
(inc! 'idx))
(if (ends-with title "Material")
(mat-table--set-weight-column table row))
(table--fix-row-height table row row-ht))
(defun-r 'table-set-row)
(defun-q table-add-data (table datas / row)
"Adds bulk data to the end of TABLE with regeneration suppressed
DATAS is a list of data lists representing row data."
(declare (vars (table vla-object (table-p table))
(datas list (vl-every 'data-list-p datas))))
(setq row (1- (table-get-nrows table)))
(vla-put-RegenerateTableSuppressed table :vlax-true)
(table-insert-rows table (length datas) row)
(foreach data datas (inc! 'row) (table-set-row table row data))
(vla-put-RegenerateTableSuppressed table :vlax-false))
(defun-r 'table-add-data)
(defun-q parse-table (table / gettext empty-first-col format-col-name header-row rows ncols cols)
"Returns the data in TABLE as a list of data lists
Each list item corresponse to a row. The keys of the datalists correspond to the column
names. The names are converted to lowercase and spaces are replaced with underscores to
form the key names.
Rows whose first column is blank are not considered. The first row is the title row, with
the table title at 0,0. The second row is considered the header row and column names come
from this row."
(declare (vars (table vla-object (table-p table))))
(setq row 1
last-row (- (vla-get-Rows table) 1)
col -1
last-col (- (vla-get-Columns table) 1))
(while (<= (inc! 'row) last-row)
(while (<= (inc! 'col) last-col)
(add-to-list 'line (vla-GetText table row col)))
(if (/= (car line) "") (add-to-list 'ret line))
(setq col -1
line nil))
ret)
(defun gettext (nrow ncol) (vla-GetText table nrow ncol))
(defun empty-first-col (nrow) (= (gettext nrow 0) ""))
(defun format-col-name (name) (string-subst-all "_" " " (lowercase name)))
(setq header-row (table--get-header-row table)
rows (range (1+ header-row) (vla-get-Rows table) 1)
ncols (range 0 (vla-get-Columns table) 1)
cols (mapcar '(lambda(ncol) (format-col-name (gettext header-row ncol)))
ncols))
(strip-nil
(mapcar
'(lambda(nrow)
(if (not (empty-first-col nrow))
(mapcar '(lambda(col-name ncol) (list col-name (gettext nrow ncol)))
cols ncols)))
rows)))
(defun-r 'parse-table)
(defun-q table--fix (table)
"Performs all necessary fixes on TABLE
Currently:
%table--abbr-desc-column
%mat-table--fix-summary-row (material tables only)
"
(declare (vars (table vla-object (table-p table))))
(table--abbr-desc-column table)
(if (material-table-p table) (mat-table--fix-summary-row table))
table)
(defun-r 'table--fix)
(defun-q table--abbr-desc-column (table / col-names header-row desc-col)
"If there is a \"Description\" column in TABLE, rewrites it as \"Desc\""
(declare (vars (table vla-object (table-p table))))
(setq col-names (table-get-column-names table))
(if (member "description" col-names)
(vla-SetText table
(table--get-header-row table)
(vl-position "description" col-names)
"Desc"))
table)
(defun-r 'table--abbr-desc-column)
(defun-q mat-table--fix-summary-row (table / row)
"Change the last row to be a simple sum of weight column if necessary"
(declare (vars (table vla-object (table-p table))))
(setq row (1- (vla-get-Rows table)))
(if (= (vla-GetText table row 3) "Tot Wt")
(progn
(mapcar '(lambda(col)
(vla-SetText table row col ""))
'(3 4 5 6))
(mat-table--update-total-weight table))))
(defun-r 'mat-table--fix-summary-row)
(defun-q table--decimal-format-cell (table row col)
"Wrapper for vla-SetCellFormat"
(declare (vars (table vla-object (table-p table))
(row int)
(col int)))
(vla-setvar 'luprec 1)
(vla-SetCellDataType table row col acDouble acUnitDistance)
(vla-SetCellFormat table row col "%lu2%pr1"))
(defun-r 'table--decimal-format-cell)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; material table specific functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun-q mat-table--update-marks (table +- n row / prefix row rows mark marks)
"Update fab mark numbers in TABLE and callouts
+- should be one of the built-in functions + or -, indicating whether the mark numbers
should increase or decrease. N is the number of places the number should jump. ROW is the
first row in the material table containing mark numbers to change."
(declare (vars (table vla-object (table-p table))
(+- subr (member +- (list + -)))
(n int)
(row int)))
(defun new-mark (mark)
(strcat prefix (to-string (+- (atoi (vl-string-left-trim prefix mark)) n))))
(setq mark-col (vl-position "mark" (table--get-column-names-maybe table))
prefix (vl-string-right-trim "0123456789" (vla-GetText table 2 mark-col))
rows (1- (vla-get-Rows table)))
(while (and (< row rows)
(or (begins-with (setq mark (vla-GetText table row mark-col)) prefix)
(= mark "")))
(if (/= mark "")
(progn
(add-to-list 'marks (list mark (new-mark mark)))
(vla-SetText table row mark-col (new-mark mark))))
(inc! 'row))
(mapcar '(lambda(x) (vla-replace-string modelSpace (car x) (cadr x)))
((if (= +- +) reverse identity) marks))
(vla-Regen acadDoc acAllViewPorts))
(defun-r 'mat-table--update-marks)
(defun-q mat-table--update-total-weight (table / row col col-letter header-row need-weight-p)
"Updates the formula for each weight in TABLE to include any added rows"
(declare (vars (table vla-object (table-p table) (material-table-p table))))
(setq col (vl-position "weight" (table--get-column-names-maybe table))
col-letter (table--column-name->letter "weight")
header-row (table--get-header-row table)
row header-row
last-row (1- (vla-get-Rows table))
need-weight-p T)
(while (< (inc! 'row) last-row)
(if (/= (vla-GetText table row col) "")
(setq need-weight-p nil
row last-row)))
(if need-weight-p
(vla-SetText table (1+ header-row) col "0.0"))
(table--decimal-format-cell table row col)
(vla-SetText table last-row col
(strcat "=SUM("
col-letter
(to-string (+ 2 header-row))
":"
col-letter
(to-string last-row)
")")))
(defun-r 'mat-table--update-total-weight)
(defun-q mat-table--set-weight-column (table row / formula weight-col wid-col len-col qty-col)
"Does necessary formatting and sets the weight column"
(declare (vars (table vla-object (table-p table))
(row int)))
(setq weight-formula (mat-table--calc-weight-formula table row))
(if weight-formula
(progn
(setq weight (vl-position "weight" cols))
(table--decimal-format-cell table row weight)
(vla-SetText table row weight weight-formula)
(table--decimal-format-cell table row weight))))
(defun-r 'mat-table--set-weight-column)
(defun-q mat-table--calc-weight-formula (table row / cols description line wt wt-type col)
"Returns the weight formula for a material description
For qty, weight, and length columns, if they are required and a null value is present, set the column to a default value. For weight and length, the default is 0. For qty, the default is 1 (Misc Material) or the number of assemblies (Material)."
(declare (vars (table vla-object (table-p table))
(row int)))
(setq cols (table--get-column-names-maybe table)
description (vla-GetText table row (vl-position "desc" cols))
line (assoc description (read-csv "fab/material.csv")))
(if line
(progn
(defun col (name)
(strcat (table--column-name->letter name) (to-string (1+ row))))
(defun coldefault (col / coln def)
(setq coln (vl-position col cols)
def (cond ((member col '("width" "length"))
"0")
((= col "qty")
(if (= (table-get-title table) "Material")
(to-string (length (parse-table (get-table-by-title "Assembly*"))))
"1"))))
(if (= (vla-GetText table row coln) "")
(vla-SetText table row coln def)))
(setq wt (nth 1 line)
wt-type (nth 2 line))
(cond ((= wt-type "sqft")
(mapcar 'coldefault '("qty" "width" "length"))
(strcat "=(" (col "qty") "*" (col "length") "*" (col "width") "/144)*" wt))
((= wt-type "foot")
(mapcar 'coldefault '("qty" "length"))
(strcat "=(" (col "qty") "*" (col "length") "/12)*" wt))
((= wt-type "each")
(coldefault "qty")
(strcat "=" (col "qty") "*" wt))))))
(defun-r 'mat-table--calc-weight-formula)

@ -183,3 +183,29 @@ returns the list (\"hello\" \"world\")."
url)
(defun-r 'escape-url)
(defun-q increment-mark (mark / glyphs i carry ret)
"Return the next string in spreadsheet column order"
(declare (vars (mark str))
(tests (= (increment-mark "A") "B")
(= (increment-mark "Z") "AA")
(= (increment-mark "ZZ") "AAA")))
(setq glyphs (vl-string->list "ABCDEFGHJKLMNQRSTWXYZ")
mark (reverse (vl-string->list mark))
carry T)
(while (and carry mark)
(setq i (vl-position (car mark) glyphs))
(add-to-list 'ret
(if (= i (1- (length glyphs)))
(progn
(setq carry T)
(car glyphs))
(progn
(setq carry nil)
(nth (1+ i) glyphs))))
(setq mark (cdr mark)))
(cond (mark
(setq ret (append ret mark)))
(carry
(setq ret (cons (ascii "A") ret))))
(vl-list->string (reverse ret)))
(defun-r 'increment-mark)

@ -160,7 +160,7 @@
Similarity is determined by equality on the values of keys listed in KEYS. PRIMARY-KEY, if
provided, is the unique ID key for a list. The values of this key are preserved in the
final grouping. If a key named 'qty' is present in KEYS, it will be preserved and
final grouping. If a key named 'qty' is present in DATALSTS, it will be preserved and
incremented to reflect grouping."
(defun memb (elt / i h ret)
(setq i 0

Loading…
Cancel
Save