Community
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Nick Schuckert" <Oh
href="mailto:nospam_NickSchuckert@Comcast.net">nospam_NickSchuckert@Comcast.net>
wrote in message
href="news:6077929@discussion.autodesk.com">news:6077929@discussion.autodesk.com...
what a mess! I just viewed my posting through my news reader.
"Nick
Schuckert" <
href="mailto:nospam_NickSchuckert@Comcast.net">nospam_NickSchuckert@Comcast.net>
wrote in message
href="news:6077928@discussion.autodesk.com">news:6077928@discussion.autodesk.com...
Hi,<br
/><br />I am working on a program in AutoCAD 2008 to populate the
Custom property <br />sheet fields with attribute tag names and
values read
from a title block.<br /><br />The problem that I
am having is when the
attribute tag names are written to <br />the
Custom property sheet "Name"
fields they are written in lower-case even
<br />though they are defined in
the block as upper-case. I have
tried forcing the <br />attribute tag names
to upper-case which has
no affect.<br /><br />So, I am at a loss. Does
anyone have any
ideas?<br /><br />Below is my work in progress program. I
have
also included a screen capture <br />of the Custom property sheet after
it has been populated.<br /><br />namespace Engineering<br
/>{<br />
public class EngineeringCommands<br
/> {<br />
[CommandMethod("UPS")]<br
/> public static void
UpdatePropertySheet()<br
/> {<br
/>
Database db =
HostApplicationServices.WorkingDatabase;<br />
DatabaseSummaryInfo dbSummaryInfo;<br />
DatabaseSummaryInfoBuilder dbSummaryInfoBuilder =<br
/>
new
DatabaseSummaryInfoBuilder();<br /><br
/> using
(Transaction tr =
<br
/>db.TransactionManager.StartTransaction())<br
/>
{<br />
BlockTable bt =<br
/>
tr.GetObject(db.BlockTableId,
OpenMode.ForRead)<br
/>
as BlockTable;<br /><br />
string titleBlock = "22X34";<br
/>
if (bt.Has(titleBlock))<br
/>
{<br
/>
BlockTableRecord btr =<br />
tr.GetObject(bt[titleBlock],
OpenMode.ForRead)<br />
as BlockTableRecord;<br
/>
if (btr != null)<br />
{<br
/>
ObjectIdCollection objIdCol =<br />
btr.GetBlockReferenceIds(true,
true);<br
/>
if
(objIdCol.Count == 1)<br
/>
{<br />
BlockReference br =<br />
tr.GetObject(objIdCol[0], OpenMode.ForRead)<br />
as
BlockReference;<br
/>
if (br != null)<br />
{<br
/>
foreach (ObjectId attId in <br
/>br.AttributeCollection)<br
/>
{<br />
AttributeReference ar =<br />
tr.GetObject(attId,
<br />OpenMode.ForRead)<br />
as AttributeReference;<br
/><br />
dbSummaryInfoBuilder.CustomProperties.Add(ar.Tag, <br
/>ar.TextString);<br
/>
// For AutoCAD 2009, delete the <br
/>statement<br
/>
// above and uncomment
the statement <br />below.<br />
//dbSummaryInfoBuilder.CustomPropertyTable.Add(ar.Tag, <br
/>ar.TextString);<br
/>
}<br />
dbSummaryInfo = <br
/>dbSummaryInfoBuilder.ToDatabaseSummaryInfo();<br />
HostApplicationServices.WorkingDatabase.SummaryInfo <br />=
dbSummaryInfo;<br
/>
}<br
}<br
/>
}<br
/>
}<br />
tr.Commit();<br /> }<br />
}<br /> }<br />}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
href="mailto:tony.tanzillo@THE_URL_BELOW.com">tony.tanzillo@THE_URL_BELOW.com>
wrote in message
href="news:6077970@discussion.autodesk.com">news:6077970@discussion.autodesk.com...
The issue has been discussed here before and
reported.
I haven't checked if it was addressed in
AutoCAD 2009.
They didn't do a very good job on that, and there's no known
workaround for it. They unwisely used a StringDictionary
for
storing the data, and it always converts its keys to
lowercase.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/Acad...
size=2>