how to change hinge to existing defined hinge in sap2000 model by SM toolbox

2 ビュー (過去 30 日間)
Ali
Ali 2024 年 12 月 18 日
回答済み: UDAYA PEDDIRAJU 2024 年 12 月 27 日
I have defined hinges in existing sap2000 model and I opend this model by matlab using SM toolbox and I thave tried to change the assigned hinges with another defined hinges but I did not find any code using SM toolbox codes

回答 (1 件)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU 2024 年 12 月 27 日
Hi Ali,
The following code might help you:
SapObject = actxserver('SAP2000.SapObject');
% Start Sap2000 application
SapObject.ApplicationStart;
Sap = SapObject.SapModel;
Sap.File.OpenFile([FilePath,'.sdb'])
% Define the hinge properties
oldHingeName = 'OldHinge'; % Name of the existing hinge
newHingeName = 'NewHinge'; % Name of the new hinge to assign
% Get the number of hinges in the model
numHinges = Sap.Hinges.Count;
% Loop through each hinge to change it
for hingeIndex = 1:numHinges
% Get the hinge name
[hingeName, ~] = Sap.Hinges.GetName(hingeIndex);
% Check if it matches the old hinge name
if strcmp(hingeName, oldHingeName)
% Change the hinge to the new hinge
Sap.Hinges.SetHinge(hingeIndex, newHingeName);
end
end
% close Sap2000
SapObject.ApplicationExit(false());
SapModel = 0;
SapObject = 0;
If the above workaround doesn't help, you may need to check the following query with similar details: https://www.mathworks.com/matlabcentral/answers/2062232-how-can-i-edit-the-hinges-already-previously-created-in-the-object.
Let me know if anything works for you?

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by