This is an idea I was pondering and thought I would write it down.
There are many Layer Creators out there but I thought this may be more versatile and
give some a chance to do some programing. I think
Kerry's layer creator could be use as
part of the routine. It would be a great engine for the create part.
My idea is to have the end user create a Layer Data File, nothing new here. But to allow
the user to set the format of the data with a KEY record that the routine would use to
read the data. Also a default KEY that would be used when there was no data included
for that propriety. This would allow blank fields within each record.
I suppose you could consider this a CHALLENGE or a collaborative effort project.
Just rehashing and old idea.
Comments & suggestions welcome.
============================================================================
This is my pseudo code for the new routine.
Get a file pick from user (assume extension .lay)
Alternatly the file could be a CSV or XLS file
Read the file into a list
Find first line starting with */ and assume it is the format key data
Find the *+ Default Data record if included
Find any *- lines for LineType File Names
Assume lines starting with * or / or ; to be comment lines
Strip out any blank or * lines
Separate remaining lines into list of data using the separator character
Proceed to create the layers, maybe report on progress
Report completion of the routine
Each line could be a subroutine thus dividing up the project.
============================================================================
Format key is a method to allow the user to create a layer data file relevant to there needs
Only the layer Name is required & the order of data is left up to the user
Format key data starts with */
Data separated with <space> characters
Next character is the data separator, this applies to the layer data only
Followed by the key for each column of data, this could be in any order but the layer data must follow this order
Format key Example:
*/ ; name color LineType
LtFile PlotStyleName Discription
-< Properties available >-
name
color
Freeze
LayerOn
Lock
Linetype
lineweight
description
plottable
PlotStyleName
LtFile is not a property of the Layer Object but a way to locate the Line Type file
If
LtFile is included it will be the first file searched for the line type
else acad.lin or acadiso.lin will be searched next then the supplied LineType files will be searched in the order supplied.
Line Type file names line start with *-
Example:
*- MyLtFile.lin
*- CABltfile.lin
Include path if not in the ACAD search path.
Default Data is a way to set the data when none is included in the layer record
This data must be in the same order as the Format Key Data
Example:
*/ ; name PlotStyleName color LineType Freeze Lock LayerOn
*+ Default Data ; Light ;7 ; Continuous; thawed; Unlocked; on
FJ1_A-DIMS ; ; ; ; ; ;
Perhaps there should be a flag to update or skip existing layers of the same name.
This would likely be a global flag that applied to all layers in the data file.
Layer Data File Example:
Note that leading & trailing space characters in each field will be deleted
Blank lines will be ignored
*=====================
* Framing Layer Data File
*=====================
* Used for residential framing plans with two stories
*- CABltfile.lin
*/ ; name PlotStyleName color LineType Freeze Lock LayerOn
*+ Default Data ; Light ;7 ; Continuous; thawed; Unlocked; on
FJ1_A-DIMS ; xLight ;1 ; Continuous; thawed; Unlocked; on
FJ1_BREAKLINE ; Light ;7 ; Continuous; thawed; Unlocked; on
FJ1_Beam ; Heavy ;1 ; Short Dash; thawed; Unlocked; on
FJ1_Bearing Wall ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ1_FINISH_TAGS ; xLight ;7 ; Continuous; thawed; Unlocked; on
FJ1_Floor Joist ; Medium ;3 ; CENTER2 ; thawed; Unlocked; on
FJ1_Hatch Lite ; xL_Scrn ;26 ; Continuous; thawed; Unlocked; on
FJ1_LEADERS ; xLight ;7 ; Continuous; thawed; Unlocked; on
FJ1_LINE ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ1_POLYLINE ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ1_RECTANG ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ1_Roof ; Medium ;40 ; HDR ; thawed; Unlocked; on
FJ1_SECTION_TAGS ; xLight ;7 ; Continuous; thawed; Unlocked; on
FJ1_StrongBack ; Heavy ;1 ; CENTER2 ; thawed; Unlocked; on
FJ1_TEXT ; Light ;92 ; Continuous; thawed; Unlocked; on
FJ2_A-DIMS ; Light ;1 ; Continuous; thawed; Unlocked; on
FJ2_BREAKLINE ; Light ;7 ; Continuous; thawed; Unlocked; on
FJ2_Beam ; Heavy ;12 ; Short Dash; thawed; Unlocked; on
FJ2_CIRCLE ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ2_Ceiling Detail ; Medium ;13 ; Short Dash; thawed; Unlocked; on
FJ2_DIM ; xLight ;1 ; Continuous; thawed; Unlocked; on
FJ2_ELLIPSE ; Light ;7 ; Continuous; thawed; Unlocked; on
FJ2_Engineering ; Light ;54 ; Continuous; thawed; Unlocked; on
FJ2_FINISH_TAGS ; xLight ;7 ; Continuous; thawed; Unlocked; on
FJ2_FIRE_PROTECTION; Light ;7 ; Continuous; thawed; Unlocked; on
FJ2_Floor Joist ; Medium ;82 ; CENTER2 ; thawed; Unlocked; on
FJ2_GOBOLT ; Medium ;220; Continuous; thawed; Unlocked; on
FJ2_LEADERS ; xLight ;7 ; Continuous; thawed; Unlocked; on
FJ2_LINE ; Medium ;22 ; Continuous; thawed; Unlocked; on
FJ2_POLYLINE ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ2_REBAR ; Heavy ;7 ; Continuous; thawed; Unlocked; on
FJ2_RECTANG ; Medium ;7 ; Continuous; thawed; Unlocked; on
FJ2_Roof ; Medium ;13 ; HDR ; thawed; Unlocked; on
FJ2_RoofOver ; Light ;1 ; HDR ; thawed; Unlocked; on
FJ2_SECTION_TAGS ; xLight ;7 ; Continuous; thawed; Unlocked; on
FJ2_ShearWall ; xL_Scrn ;52 ; Continuous; thawed; Unlocked; on
FJ2_TEXT ; Light ;2 ; Continuous; thawed; Unlocked; on
** E N D O F F I L E