Block Attribute Modification
This command allows Blocks to be modified, where Attributes can be added/modified for each Block.
Command Line
<inputfile>.dwg -europ=<json_command_file>.json
This command-line utilizes the JSON command file to define other needed parameters. Alternatively, the command line can be expanded, and the Parameters Section can be omitted in the JSON command file. This would yield the command line:
<inputfile>.dwg -europ=<json_command_file>.json -rl=EP-SUPERFICI -bl="EP-RISCHIO MEDIO” -tltag="COD_LOCALE”
The Definitions and Areas sections of the JSON command file are still required to modify block attributes. The extra command-line parameters would replace the Parameters section.
JSON Command File
The JSON Command File has either two or three sections, depending on whether the Parameters Section is defined (see above).
Parameters Section
Defines any command-line parameters except the Input File Name. The Input File Name changes frequently so it is not a good candidate to define in the JSON file.
"Parameters": {
"rl" : "EP-SUPERFICI",
"bl" : "EP-RISCHIO MEDIO",
"tltag" : "COD_LOCALE"
},
Definitions Section
The Definitions Section defines which Block is to be modified and the Attributes that should be added/modified for each Block.
| Name | Purpose |
|---|---|
| Name | Defines the name of the Attribute |
| Prompt | Defines the prompt for the Attribute |
| Position | Defines the Position of the Attribute. This is relative to the Base Point of the Block Definition and is expressed in Block Reference Coordinate space, not Block Definition coordinates—the same values used in the Area Section below. This is an array of the form [x,y] or [x,y,z]. The z-coordinate is ignored and treated as zero. |
| Height | Defines the Height of the Attribute. This is in Block Reference Coordinate space, not Block Definition coordinates—the same values as used in the Area Section below. |
| Ordinal | Defines the order of the Attribute. This parameter is currently not used. |
Areas Section
The Areas Section defines any Attribute value overrides for the Blocks in the file. This is an array of Area Definitions, one for each Block to be modified.
Base Information
| Name | Purpose |
|---|---|
| RoomID | Defines the Room Identifier of the Attribute |
| Tenant | Defines the Tenant for the Attribute. This is not currently used |
| BlockName | Defines the Block Name for the Attribute. This must agree with the Name for a Block defined in the Definitions section. |
| Extra Info | Defines the Attribute Overrides for the Block. This is similar to the Definitions Section. |
Extra Info
| Name | Purpose |
|---|---|
| Name | Defines the name of the Attribute |
| Value | Defines the value for the Attribute |
| Position | Defines the Position of the Attribute. This is relative to the Base Point of the Block Reference. This is an array of the form [x, y] or [x, y, z]. The z-coordinate is ignored and treated as zero. |
| Height | Defines the Height of the Attribute. |
| Color | Defines the Color for the Attribute. This is represented in AutoCAD Index values (i.e., 1 is Red, 7 is Black/White, etc.) |
| Ordinal | Defines the order of the Attribute. This parameter is currently not used. |
Complete Sample JSON
Below is a complete sample JSON, modifying and adding content to blocks attributes in a given source DWG drawing.
{
"Parameters" : {
"rl" : "EP-SUPERFICI",
"bl" : "EP-RISCHIO MEDIO",
"tltag" : "COD_LOCALE"
},
"Definitions" : {
"BLOCKNAME" : "ETICHETTA",
"ATTRIBUTES" : [
{
"Name": "Uno",
"Prompt": "Define One",
"Position": [-0.663855,-0.22],
"Height": 0.18,
"Ordinal": 1
},
{
"Name": "Due",
"Prompt": "Define Two",
"Position": [-0.663855,-0.47],
"Height": 0.18,
"Ordinal": 2
},
{
"Name": "tre",
"Prompt": "Define Three",
"Position": [-0.663855,-0.72],
"Height": 0.18,
"Ordinal": 3
},
{
"Name": "quattro",
"Prompt": "Define Four",
"Position": [-0.663855,-0.97],
"Height": 0.18,
"Ordinal": 4
}
]
},
"Areas" : [
{
"RoomId": "1004",
"Tenant": "CAPO SALA",
"BLOCKNAME" : "ETICHETTA",
"Extra Info": [
{
"Name": "Uno",
"Value": "Item One",
"Position": [-0.663855,-0.22],
"Height": 0.18,
"Color": 1,
"Ordinal": 1
},
{
"Name": "Due",
"Value": "Item Two",
"Position": [-0.663855,-0.47],
"Height": 0.18,
"Color": 1,
"Ordinal": 2
},
{
"Name": "tre",
"Value": "Item Three",
"Position": [-0.663855,-0.72],
"Height": 0.18,
"Color": 1,
"Ordinal": 3
},
{
"Name": "quattro",
"Value": "Item Four",
"Position": [-0.663855,-0.97],
"Height": 0.18,
"Color": 1,
"Ordinal": 4
}
]
},
{
"RoomId": "1005",
"Tenant": "MAG MAT GEN",
"BLOCKNAME" : "ETICHETTA",
"Extra Info": [
{
"Name": "Uno",
"Value": "Item One",
"Position": [-0.663855,-0.22],
"Height": 0.18,
"Color": 2,
"Ordinal": 1
},
{
"Name": "Due",
"Value": "Item Two",
"Position": [-0.663855,-0.47],
"Height": 0.18,
"Color": 2,
"Ordinal": 2
}
]
},
{
"RoomId": "1008",
"Tenant": "VUOTATOIO",
"BLOCKNAME" : "ETICHETTA",
"Extra Info":
{
"Name": "Uno",
"Value": "Item Fifty Eight",
"Position": [-0.663855,-0.22],
"Height": 0.18,
"Color": 3,
"Ordinal": 1
}
}
]
}