how to change hinge to existing defined hinge in sap2000 model by SM toolbox
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
UDAYA PEDDIRAJU
am 27 Dez. 2024
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 Kommentare
Siehe auch
Kategorien
Mehr zu QSP, PKPD, and Systems Biology finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!