how to change hinge to existing defined hinge in sap2000 model by SM toolbox
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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.
Also, I found one more relevent link: 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?
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!