diff --git a/SRC/interpreter/OpenSeesCommands.h b/SRC/interpreter/OpenSeesCommands.h index a675f97ba..2b843ea7b 100644 --- a/SRC/interpreter/OpenSeesCommands.h +++ b/SRC/interpreter/OpenSeesCommands.h @@ -261,6 +261,7 @@ int OPS_setNodePressure(); int OPS_nodeBounds(); int OPS_setPrecision(); int OPS_getEleTags(); +int OPS_getCrdTransfTags(); int OPS_getNodeTags(); int OPS_getParamTags(); int OPS_getParamValue(); diff --git a/SRC/interpreter/OpenSeesOutputCommands.cpp b/SRC/interpreter/OpenSeesOutputCommands.cpp index 79225e49f..25acb3e15 100644 --- a/SRC/interpreter/OpenSeesOutputCommands.cpp +++ b/SRC/interpreter/OpenSeesOutputCommands.cpp @@ -54,6 +54,7 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include #include +#include #include #include #include @@ -2004,6 +2005,25 @@ int OPS_getEleTags() return 0; } +int OPS_getCrdTransfTags() +{ + // Defined in CrdTransf.cpp + ID transfTags = OPS_getAllCrdTransfTags(); + + int size = transfTags.Size(); + int *data = 0; + if (size > 0) { + data = &transfTags[0]; + } + + if (OPS_SetIntOutput(&size, data, false) < 0) { + opserr << "WARNING failed to set outputs\n"; + return -1; + } + + return 0; +} + int OPS_getNodeTags() { Domain *theDomain = OPS_GetDomain(); if (theDomain == 0) return -1; diff --git a/SRC/interpreter/PythonWrapper.cpp b/SRC/interpreter/PythonWrapper.cpp index 850ff0212..ed10b1c48 100644 --- a/SRC/interpreter/PythonWrapper.cpp +++ b/SRC/interpreter/PythonWrapper.cpp @@ -1415,6 +1415,18 @@ static PyObject *Py_ops_getEleTags(PyObject *self, PyObject *args) return wrapper->getResults(); } +static PyObject *Py_ops_getCrdTransfTags(PyObject *self, PyObject *args) +{ + wrapper->resetCommandLine(PyTuple_Size(args), 1, args); + + if (OPS_getCrdTransfTags() < 0) { + opserr<<(void*)0; + return NULL; + } + + return wrapper->getResults(); +} + static PyObject *Py_ops_getNodeTags(PyObject *self, PyObject *args) { wrapper->resetCommandLine(PyTuple_Size(args), 1, args); @@ -2497,6 +2509,7 @@ PythonWrapper::addOpenSeesCommands() addCommand("convertBinaryToText", &Py_ops_convertBinaryToText); addCommand("convertTextToBinary", &Py_ops_convertTextToBinary); addCommand("getEleTags", &Py_ops_getEleTags); + addCommand("getCrdTransfTags", &Py_ops_getCrdTransfTags); addCommand("getNodeTags", &Py_ops_getNodeTags); addCommand("getParamTags", &Py_ops_getParamTags); addCommand("getParamValue", &Py_ops_getParamValue); diff --git a/SRC/interpreter/TclWrapper.cpp b/SRC/interpreter/TclWrapper.cpp index da18d7d9a..d23a03e54 100644 --- a/SRC/interpreter/TclWrapper.cpp +++ b/SRC/interpreter/TclWrapper.cpp @@ -901,6 +901,14 @@ static int Tcl_ops_getEleTags(ClientData clientData, Tcl_Interp *interp, int arg return TCL_OK; } +static int Tcl_ops_getCrdTransfTags(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) { + wrapper->resetCommandLine(argc, 1, argv); + + if (OPS_getCrdTransfTags() < 0) return TCL_ERROR; + + return TCL_OK; +} + static int Tcl_ops_getNodeTags(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) { wrapper->resetCommandLine(argc, 1, argv); @@ -1673,6 +1681,7 @@ TclWrapper::addOpenSeesCommands(Tcl_Interp* interp) addCommand(interp,"convertBinaryToText", &Tcl_ops_convertBinaryToText); addCommand(interp,"convertTextToBinary", &Tcl_ops_convertTextToBinary); addCommand(interp,"getEleTags", &Tcl_ops_getEleTags); + addCommand(interp,"getCrdTransfTags", &Tcl_ops_getCrdTransfTags); addCommand(interp,"getNodeTags", &Tcl_ops_getNodeTags); addCommand(interp,"getParamTags", &Tcl_ops_getParamTags); addCommand(interp,"getParamValue", &Tcl_ops_getParamValue);