Author Topic: reinvent the wheel  (Read 7490 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #15 on: May 22, 2010, 10:48:09 AM »
WOW! I am so in over my head....
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

jgr

  • Guest
Re: reinvent the wheel
« Reply #16 on: May 22, 2010, 10:55:34 PM »
I do not speak English, and maybe did not understand the question. But:

(electrical schematic/wiring ) For breack lines you can use (Entity) points on blocks (see http://patrice.delseaux.free.fr/ , is lisp, but to get an idea is good) or store this break points in a database .
« Last Edit: May 22, 2010, 11:15:34 PM by jgr »

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #17 on: May 25, 2010, 07:20:37 PM »
OK, after reading much of that, I'm seeing DXF codes being used.  Is this correct or is there another list I should be looking at?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #18 on: May 27, 2010, 03:37:18 PM »
I have been playing around with this for a few days, and found that it looks like I can use any number I want.  Is there a standard for which DXF codes should be used in XRecords?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: reinvent the wheel
« Reply #19 on: May 27, 2010, 04:03:38 PM »
I have been playing around with this for a few days, and found that it looks like I can use any number I want.  Is there a standard for which DXF codes should be used in XRecords?

For what numbers to use, look in the Dev Help, look at the ' DXF Reference ' section.  Then ' DXF Format ', then ' Group Code Value Types ' or ' Group Codes in Numerical Order '.  Here is a quote from the former.

Quote
Code range
 Group value type
 
0-9
 String (with the introduction of extended symbol names in AutoCAD 2000, the 255-character limit has been increased to 2049 single-byte characters not including the newline at the end of the line)
 
10-39
 Double precision 3D point value
 
40-59
 Double-precision floating-point value
 
60-79
 16-bit integer value
 
90-99
 32-bit integer value
 
100
 String (255-character maximum; less for Unicode strings)
 
102
 String (255-character maximum; less for Unicode strings)
 
105
 String representing hexadecimal (hex) handle value
 
110-119
 Double precision floating-point value
 
120-129
 Double precision floating-point value
 
130-139
 Double precision floating-point value
 
140-149
 Double precision scalar floating-point value
 
170-179
 16-bit integer value
 
210-239
 Double-precision floating-point value
 
270-279
 16-bit integer value
 
280-289
 16-bit integer value
 
290-299
 Boolean flag value
 
300-309
 Arbitrary text string
 
310-319
 String representing hex value of binary chunk
 
320-329
 String representing hex handle value
 
330-369
 String representing hex object IDs
 
370-379
 16-bit integer value
 
380-389
 16-bit integer value
 
390-399
 String representing hex handle value
 
400-409
 16-bit integer value
 
410-419
 String
 
420-429
 32-bit integer value
 
430-439
 String
 
440-449
 32-bit integer value
 
450-459
 Long
 
460-469
 Double-precision floating-point value
 
470-479
 String
 
999
 Comment (string)
 
1000-1009
 String (same limits as indicated with 0-9 code range)
 
1010-1059
 Double-precision floating-point value
 
1060-1070
 16-bit integer value
 
1071
 32-bit integer value
 

For Xrec specific, then look at: DXF Reference -> Objects Section -> Xrecords.  Here is the quote from there.

Quote
The following group codes are common to all xrecord objects. In addition to the group codes described here, see Common Group Codes for Objects. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference.

Xrecord group codes
 
Group code
 Description
 
100
 Subclass marker (AcDbXrecord)
 
280
 Duplicate record cloning flag (determines how to merge duplicate entries):

0 = Not applicable

1 = Keep existing

2 = Use clone

3 = <xref>$0$<name>

4 = $0$<name>

5 = Unmangle name
 
1-369 (except 5 and 105)
 These values can be used by an application in any way
 

Xrecord objects are used to store and manage arbitrary data. They are composed of DXF group codes with “normal object” groups (that is, non-xdata group codes), ranging from 1 through 369 for supported ranges. This object is similar in concept to xdata but is not limited by size or order.

Xrecord objects are designed to work in such a way as to not offend releases R13c0 through R13c3. However, if read into a pre-R13c4 version of AutoCAD®, xrecord objects disappear.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #20 on: May 27, 2010, 04:41:17 PM »
Thanks Tim.  I read that on the net, but when I read the part about R13c0-3, I thought it must be very old information, and kept looking for newer information.  BTW, do you have a short example of storing some data in an XRECORD?  I have used a few examples I have found, but they are very generic
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: reinvent the wheel
« Reply #21 on: May 27, 2010, 05:52:14 PM »
Here is something simple.  Hope it helps.
Code: [Select]
public bool SaveXrefState ( Database db, DBDictionary dict, string name )
{
    Xrecord Xrec = new Xrecord();
    ResultBuffer rb = new ResultBuffer();
    using ( Transaction Trans = db.TransactionManager.StartTransaction() )
    {
        db.ResolveXrefs( false, true );
        XrefGraph xrGph = db.GetHostDwgXrefGraph( false );
        for ( int i = 1; i < xrGph.NumNodes; i++ )
        {
            XrefGraphNode xrNode = xrGph.GetXrefNode( i );
            BlockTableRecord btr = Trans.GetObject( xrNode.BlockTableRecordId, OpenMode.ForRead ) as BlockTableRecord;
            if ( btr == null ) continue;
            rb.Add( new TypedValue( 5, btr.Handle ) );
            rb.Add( new TypedValue( 62, ( btr.XrefStatus == XrefStatus.Unloaded ? 1 : 0 ) ) );
        }
        Xrec.Data = rb;
        if ( !dict.IsWriteEnabled ) dict.UpgradeOpen();
        dict.SetAt( name, Xrec );
        dict.DowngradeOpen();
        Trans.Commit();
    }
    return true;
}
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #22 on: May 27, 2010, 06:00:18 PM »
every thing helps!  The more examples I see the better
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #23 on: May 27, 2010, 06:34:28 PM »
OH, Its making so much sense now!!!  The wheels are starting to turn much quicker now.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: reinvent the wheel
« Reply #24 on: May 27, 2010, 06:47:13 PM »
That's always a good thing.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: reinvent the wheel
« Reply #25 on: May 27, 2010, 07:53:08 PM »
OH, Its making so much sense now!!!  The wheels are starting to turn much quicker now.

copious amounts of bourbon help lubrication David.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #26 on: May 28, 2010, 09:31:02 AM »
copious amounts of bourbon help lubrication David.
Funny you should say that, I had a good long chat with a mutual friend about various brands
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Glenn R

  • Guest
Re: reinvent the wheel
« Reply #27 on: May 28, 2010, 10:23:01 AM »
OH, Its making so much sense now!!!  The wheels are starting to turn much quicker now.

copious amounts of bourbon help lubrication David.

Hear, hear! Seconded.

copious amounts of bourbon help lubrication David.
Funny you should say that, I had a good long chat with a mutual friend about various brands

Yes it was a good chat, especially on the relative merits of the different brands.

BTW Duh, you will see some Extension dictionary and Xrecord usage in that XrefStates application I posted to 'tool of the month' for another example.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #28 on: May 28, 2010, 11:32:10 AM »
Very cool stuff.  Lots to study..... My brain hurts
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: reinvent the wheel
« Reply #29 on: July 09, 2010, 12:38:54 PM »
OK, Next question-  What is the proper way to store an XRecord to a drawing as a whole?  Should I use the NOD of the drawing or create my own dictionary?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)