Hi Brent,
Nothing like the help files to get sample code.
Type a line of code like:
Dim x as AcadDictionary
Select the word "AcadDictionary" and press F1, the look for sample code.
Regards
Laurie Comerford
Sub Example_Add()
' This example adds a block, dictionary, dimension style,
' group, layer, registered application, selection set,
' textstyle, view, viewport and UCS using the Add method.
GoSub ADDBLOCK
GoSub ADDDICTIONARY
GoSub ADDDIMSTYLE
GoSub ADDGROUP
GoSub ADDLAYER
GoSub ADDREGISTEREDAPP
GoSub ADDSELECTIONSET
GoSub ADDTEXTSTYLE
GoSub ADDVIEW
GoSub ADDVIEWPORT
GoSub ADDUCS
GoSub ADDMATERIAL
Exit Sub
ADDBLOCK:
' Create a new block called "New_Block"
Dim blockObj As AcadBlock
' Define the block
Dim insertionPnt(0 To 2) As Double
insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
' Add the block to the blocks collection
Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "New_Block")
MsgBox blockObj.name & " has been added." & vbCrLf & _
"Origin: " & blockObj.origin(0) & ", " & blockObj.origin(1) _
& ", " & blockObj.origin(2), , "Add Example"
Return
ADDDICTIONARY:
' Create a new dictionary called "New_Dictionary"
Dim dictObj As AcadDictionary
' Add the dictionary to the dictionaries collection
Set dictObj = ThisDrawing.Dictionaries.Add("New_Dictionary")
MsgBox dictObj.name & " has been added.", , "Add Example"
Return
BMcAnney wrote:
> I'm looking for some example code to let me save some simple data to a
> dictionary in the drawing. While searching the group, I've seen many
> references to dictionary functions by Frank Oquendo posted on Acadx.com,
> but that site appears to be dead. I just need to store a small number of
> short strings in the drawing -- no more than 50 strings. Can anyone
> point me in the right direction? Thanks! Brent McAnney