Using fields in titleblock without sheet sets

Using fields in titleblock without sheet sets

Anonymous
Not applicable
1,535 Views
11 Replies
Message 1 of 12

Using fields in titleblock without sheet sets

Anonymous
Not applicable

We currently use a lisp routine to insert the state, license number & expiration date into our title sheets.

 

State Code Snippet.JPG

 

License_No.JPG

 

The lisp routine reads the state off an asci file that gets populated to insert the correct license number & expiration date.

 

Asci File.JPG

 

The problem is sometimes the lisp routine may not be updated or its an older project that needs to be updated in the titleblock that gets xrefed into the permit set drawings. We have an excel spreadsheet that gets updated when the license gets renewed. If i were to use a field to read the excel spreadsheet cell based on the state could that be regenerated every time you plot? It would need to read cell #C3-C26 based on the state which would be A3-A26. Either that or could it read the asci text file & update based on that? I would prefer that it read the excel since the asci file may or may not be created. The excel file will always be there.

 

This would probably be much easier to do with sheet sets but unfortunately my boss is not onboard with that.

 

 

0 Likes
1,536 Views
11 Replies
Replies (11)
Message 2 of 12

rkmcswain
Mentor
Mentor

As far as I know you can do what you want with data links. (see this example)

Your "field" would actually be a table pointing to the data link, which in turn is pointed to that particular cell.

I'm not sure what would happen to the data if the DWG file does not have access to the XLS file (for example, you send the DWG to someone outside the company).

0 Likes
Message 3 of 12

Anonymous
Not applicable

Thanks. I will check that out. I've tried using data links before with mixed results. Could be an option though since it will only be one line of text. I really wish i could convince my boss about sheet sets but that's a whole other issue.

0 Likes
Message 4 of 12

Anonymous
Not applicable

The other thing is usually we do it in the tittleblock drawing which gets xrefed into every other drawing. So it wouldn't get regenerated unless its in the drawing that gets opened, saved or plotted.

0 Likes
Message 5 of 12

Anonymous
Not applicable

Also, i forgot about this part but the cell number that it is referencing would change depending on the state that the project is in. If it is in New Jersey it would read the C15 cell, & if it's in Delaware it would read the C5 cell. 

0 Likes
Message 6 of 12

pbejse
Mentor
Mentor

Do you have a program that reads an excel file? Put that program om your startup routine. Assign the value to a variable name. 

 

 

 

(setq ThisData (_ReadExcelFile "THE-EXCEL-FILE" theRange ))
say....
("New Jersey" ("NJ" "5452345"))("Delaware" ("DE" "6546464"))....)
Some other condtion to determine state .. then

(setq StateOF (value from ThisData) LicenseNo (value from ThisData))

 

 

If you are intent on using Fields then use Other/LispVariable <, in this case, LicenseNo & Stateof


lispvariable.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

You can build from this idea methinks.

 

HTH

 

 

0 Likes
Message 7 of 12

Anonymous
Not applicable

We don't currently have one that i am aware of. Right now the routine reads a variable from an ascii file then inserts the text into the titleblock drawing which xrefs into each drawing of the plan,elevation, section, etc. Could it be a function in our routine? It has been working for us in this way for a while but sometimes we have a drawing where the expiration date has changed. The state & the license number is the same but the date has changed. Also i wonder if it would need to be in the plan or elevation drawing itself & not the titleblock drawing which gets xrefed in

0 Likes
Message 8 of 12

john.uhden
Mentor
Mentor

Yes, I have seen it done neatly by keeping the variable data in the sheet of the drawing that will be plotted.

I would also consider using attributes.  If you don't already have one, we can build you a routine that changes the attributes based on a simple text file, or CSV (which is the same animal by a different extension).  It could be run automatically on each drawing open and for each insertion of the certification block.  The only thing over which you would lose control is automatic line wrapping.  You would have to position each attribute at the end of a line of text and leave enough room for a potentially long attribute value.  F'rinstance "North Carolina" is quite a bit longer than "Ohio."  But that's okay; you just don't take on any work in North Carolina, or South Carolina, or Pennsylvania, or Massachusetts.  :]

John F. Uhden

0 Likes
Message 9 of 12

Anonymous
Not applicable

@john.uhden wrote:

Yes, I have seen it done neatly by keeping the variable data in the sheet of the drawing that will be plotted.

I would also consider using attributes.  If you don't already have one, we can build you a routine that changes the attributes based on a simple text file, or CSV (which is the same animal by a different extension).  It could be run automatically on each drawing open and for each insertion of the certification block.  The only thing over which you would lose control is automatic line wrapping.  You would have to position each attribute at the end of a line of text and leave enough room for a potentially long attribute value.  F'rinstance "North Carolina" is quite a bit longer than "Ohio."  But that's okay; you just don't take on any work in North Carolina, or South Carolina, or Pennsylvania, or Massachusetts.  :]


The state length wouldn't be a problem since everything will be two characters. Here is how it works now. We have two routines that completes the process. The first routine copes a series of drawings over to the project directory based on  selection of a dialog box. An ascii file gets created based on the selection that the user makes from the dialog box.

 

(setq filenm (STRCAT "P:\\" 4CHYEAR " PROJECTTYPE\\" 4CHYEAR " XXX\\" dirname "\\TITLE.ASC"))

(setq ln1 GAREA)
(setq ln2 SAREA)
(setq ln3 PNO)
(setq ln4 AUTH)
(setq ln5 PN)
(setq ln6 PAD)
(setq ln7 CITY)
(setq ln8 SNO)
(setq ln9 SNO2)
(setq ln10 STN)
(setq ln11 PTN)
(setq ln12 PTN2)
(setq ln13 STATE)
(setq ln14 ZIP)
(setq ln15 REGION)
(setq ln16 PJT)

(setq fp (open filenm "w"))
(write-line ln1 fp)
(write-line ln2 fp)
(write-line ln3 fp)
(write-line ln4 fp)
(write-line ln5 fp)
(write-line ln6 fp)
(write-line ln7 fp)
(write-line ln8 fp)
(write-line ln9 fp)
(write-line ln10 fp)
(write-line ln11 fp)
(write-line ln12 fp)
(write-line ln13 fp)
(write-line ln14 fp)
(write-line ln15 fp)
(write-line ln16 fp)

(close fp)

 

The titleblock is then opened up by the first routine & a second routine is run that populates the titleblock. The state, License number, & expiration date are inserted into the titleblock drawing based on the state that is selected in the dialog box. This is all done with text instead of attributes.

 

;SET INSERTION POINTS FOR LICENSE NUMBER, STATE & EXPIRATION DATE BY PROJECT TYPE
(IF (or (= (strcase (GETVAR "PROJECTNAME")) "RA")(= (strcase (GETVAR "PROJECTNAME")) "RA (CASH BOOTH)")(= (strcase (GETVAR "PROJECTNAME")) "RA (SBS)")(= (strcase (GETVAR "PROJECTNAME")) "ARCADE")(= (strcase (GETVAR "PROJECTNAME")) "BBV"))(setq insnum "32.869,13.464" insstate "34.539,13.624" insdate "33.258,13.303" rot "0" sty "BORDER" hgt ".0938"))
(IF (= (strcase (GETVAR "PROJECTNAME")) "IA")(setq insnum "33.9348,13.7961" insstate "33.3294,14.0555" insdate "34.2729,13.6659" rot "0" sty "Style-font096" hgt ".0781"))
(IF (= (strcase (GETVAR "PROJECTNAME")) "IAT3")(setq insnum "34.2768,16.7049" insstate "34.0206,17.3096" insdate "34.4070,16.9537" rot "90" sty "Style-font096" hgt ".0781"))

 

(DEFUN CERTIFY ()
(If (= (strcase (GETVAR "PROJECTNAME")) "ARCADE")(COMMAND "-LAYER" "M" "A-ANNO-TTLB" "C" "230" "" ""))
(COND
((= ln13 "MD")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "3633-A")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "03/08/18")
)
)
((= ln13 "CT")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "7231")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "7/31/16")
)
)
((= ln13 "DC")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "4483")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "4/30/18")
)
)
((= ln13 "DE")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "S5-0007642")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "1/31/18")
)
)
((= ln13 "VA")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "0401 007140")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "11/30/18")
)
)
((= ln13 "WV")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "4391")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "06/30/17")
)
)
((= ln13 "FL")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "AR-0013579")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13 )
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "02/28/17")
)
)
((= ln13 "IL")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "001-013842")
(COMMAND "-TEXT" "S" "BORDER" "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "12/30/16")
)
)
((= ln13 "NC")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "6038")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "06/30/16")
)
)
((= ln13 "NH")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "1971")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "08/31/17")
)
)
((= ln13 "NV")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "3238")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "12/31/17")
)
)
((= ln13 "NJ")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "1271400")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "07/31/17")
)
)
((= ln13 "NY")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "20040-1")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "07/31/18")
)
)
((= ln13 "OH")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "9603")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "12/31/17")
)
)
((= ln13 "PA")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "B-11672")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "06/30/19")
)
)
((= ln13 "SC")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "4141")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "06/30/17")
)
)
((= ln13 "MN")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "ARC1827")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "06/30/15")
)
)
((= ln13 "MA")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "7647")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "08/31/17")
)
)
((= ln13 "RI")
(progn
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "1921")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "12/31/18")
)
)
(PROGN
(COMMAND "-TEXT" "S" sty "J" "BL" insnum hgt rot "NUMBER")
(COMMAND "-TEXT" "S" sty "J" "BL" insstate hgt rot ln13)
(COMMAND "-TEXT" "S" sty "J" "BL" insdate hgt rot "DATE")
)
)
)

 

So if i did with an attribute i assume that i would have to copy that into each plan, elevation, section drawing & tab? Would that link to the excel spreadsheet & reference a certain cell? I need a way to change it depending on the state that is selected in the dialog box.

0 Likes
Message 10 of 12

john.uhden
Mentor
Mentor
You could use a very simple routine to set an xrecord in the drawing
containing the state name. This would be needed only once per drawing
unless the 7-11 arch drawings for Farmingdale, NJ are to be copied to a
project in Warrington, PA. After that we give you code that can run
automatically to read the CSV file and populate all the corresponding
attributes in every block reference in the drawing.

The CSV file would look more like:
TAG1,VALUE1
TAG2,VALUE2
ETC.3,ETC.

The block name should be constant. The only question would be to read the
appropriate CSV file, perhaps one for each project? Softdesk and Land
Desktop were project oriented, but those days are long gone. But I think
plain AutoCAD offers the ability to attach drawings to projects somehow.

John F. Uhden

0 Likes
Message 11 of 12

Anonymous
Not applicable

@john.uhden wrote:
You could use a very simple routine to set an xrecord in the drawing
containing the state name. This would be needed only once per drawing
unless the 7-11 arch drawings for Farmingdale, NJ are to be copied to a
project in Warrington, PA. After that we give you code that can run
automatically to read the CSV file and populate all the corresponding
attributes in every block reference in the drawing.

The CSV file would look more like:
TAG1,VALUE1
TAG2,VALUE2
ETC.3,ETC.

The block name should be constant. The only question would be to read the
appropriate CSV file, perhaps one for each project? Softdesk and Land
Desktop were project oriented, but those days are long gone. But I think
plain AutoCAD offers the ability to attach drawings to projects somehow.

The set of drawings are copied from a central location & used over & over again so i would need some way to have a condition where if it is in maryland you reference cell c10, & if it is in florida you reference cell c5, etc. I am hoping i can do it through an excel file because that is what gets updated when the license is renewed

0 Likes
Message 12 of 12

john.uhden
Mentor
Mentor
@Anonymous wrote "I am hoping i can do it through an excel file because that is
what gets updated when the license is renewed."

License? For some document management software?

Whatever the conditions are, I am sure that we can figure it out (with your
assistance). The license fee will probably be less than your payroll. 😉

John F. Uhden

0 Likes