You are here: Surpac Concepts > Macros > SCL > Block Model Commands > SclBlockModelAttributeExists
GEOVIA Surpac

SclBlockModelAttributeExists

Overview

You use this command to determine whether an attribute of a specified name exists in the block model. You must have the block model of interest open in Surpac to use this command.

Synopsis

SclBlockModelAttributeExists $bmHandle attributeName

Description

Determines if an attribute of the specified name exists in the block model that is open in Surpac.

Arguments

  • bmHandle
  • Passed by value. The handle to the block model. You can obtain the handle by calling the SclBlockModelGetCurrentModel command.

  • attributeName
  • Passed by reference. The name of the attribute you want to know exists in the block model.

Returns

Returns 1 if the attribute exists in the model, and returns 0 if the attribute does not exist in the model.

Examples

# check if a specific attribute exists in the model
set handle [SclBlockModelGetCurrentModel]

set result [SclBlockModelAttributeExists $handle gold]

if {$result == 1} {
	puts "Attribute gold exists in the model"
} else {
	puts "Attribute gold does not exist in the model"
}