|
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Last edited by dortega4269; 2014-07-21 at 07:54 PM.
Hey BB, that's pretty sweet.
I have written old-school routines for creating layers, which have the "dreaded" command calls.
I would like to try out your routine.
I can't open/download the txt(csv) file for the reference layers in your link (becuase I'm not a CadTutor member), any way you can post it here or send it to me?
Thanks dude!
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Cheers, tedg; to demonstrate, here's a quick speed test creating 256 layers each, with undo marks of Command calls vs. LayerTable Object....
Sample functions:
Code:;;; See "foo.lsp" attached, code is too long for this post
Sample .CSV file:
Code:;;; See "foo.csv.txt" attached, code is too long for this post, and rename as "foo.csv"
Speed test:
Code:(bench '(_Command1) '() 1) (command "._undo" 1) ; undo the command calls; no cheating ;o) (bench '(_CSV->Layers) '() 1)
Results from console...
Tested on a Dell Precision T3600, Win8.1 Pro 64-bit OS, Hex-Core Intel Xeon 3.2 Ghz, 32 GB RAM, 3 GB NVIDIA Quadro K4000 using IDSP 2015
... That's +/- 1.8 seconds for Command calls, and 0.17 seconds for LayerTable... And here's the important bit... Each-and-every-single-time you open a drawing when being loaded via AcadDoc.[lsp[fas[vlx]]].Code:_COMMAND1 Elapsed: 1812 Average: 1812.0000 _CSV->LAYERS Elapsed: 172 Average: 172.0000
The latter can also be modified to support ObjectDBX batch processing, and paired with Reactors, etc.
Cheers
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Put another way, if one only opens 5 drawings each day via the Command call method (@1.8 Sec*5==9 Sec/Day), that equates to 37.5 Hours per year, per person (estimating 50, 5 Day work weeks).
Now compare that against the latter in the same scenario, (@0.17 Sec*5==0.85 Sec/Day), that equates to only 3.54 Hours per year, per person.
Also worthy of note, is that these processing times are significantly reduced when you step up into the .NET API:
... So the real question is, how many users do you have?
Cheers
Last edited by BlackBox; 2014-07-22 at 02:32 PM.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Thank you BB. I used your routine with the variations fixo and waders made and it works
Thank you tedg also for your time and effort, you idea is being thought out further to find the ideal scenario of implementing it during startup.
If I wanted to take this a step further and only insert/overwrite specific category of layers instead of all layers (example: Casework only), what could I do to create a prompt to apply a selected category of layers? My simple thinking is to break the routine and csv file up into several routines and csv files.
Previously I used the following routine to insert my layer templates (.dwg), however, they wouldn't overwrite any existing layers, hence the start of this thread...
Code:(defun c:LayerCat (/ ip ans sel1) (setq ip (list 0 0 0)) (initget "C F EQ") (setq ans (getkword "\nSelect Layer Category to Insert [Casework/Furniture/Equipment]: ")) ib (cond ((= (strcase ans nil) "C") (progn (command "insert" "Casework" ip nil nil nil) (setq sel1 (ssget "x" '((0 . "insert") (2 . "Casework"))) ) ) ) ((= (strcase ans nil) "F") (progn (command "insert" "Furniture" ip nil nil nil) (setq sel1 (ssget "x" '((0 . "insert") (2 . "Furniture"))) ) ) ) ((= (strcase ans nil) "EQ") (progn (command "insert" "Equipment" ip nil nil nil) (setq sel1 (ssget "x" '((0 . "insert") (2 . "Equipment"))) ) ) ) ) (princ) )
Adding/Correcting layers at drawing open is very different from implementing a user Command that prompts for import.
Correct; you only need the one sub-function, but you'd need to split your .CSV data accordingly, otherwise you'd need to modify the sub-function so that it can evaluate a WCMATCH, etc. comparison to only Add the desired layers.
Decide which is best for your needs, and let us know where you get hung up.
Cheers
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Again, Thanks BB. I'll explore your recommendations further and see which is more feasible.