@@ -95,6 +95,8 @@ function buildModia3D!(model::AbstractDict, FloatType::Type, TimeType::Type,
9595 jointAccelerationsFreeMotion2 = []
9696 jointStatesFreeMotion_isrot123 = Expr[]
9797 freeMotionIndices = OrderedCollections. OrderedDict {String,Int} ()
98+
99+ modelPathAsString = isnothing (modelPath) ? " " : string (modelPath)
98100
99101 i= 1
100102 for joint in jointInfo
@@ -104,7 +106,7 @@ function buildModia3D!(model::AbstractDict, FloatType::Type, TimeType::Type,
104106 if jointType == :Revolute || jointType == :RevoluteWithFlange
105107 ndofTotal += 1
106108 NRevolute += 1
107- revoluteIndices[string (path)] = NRevolute
109+ revoluteIndices[modelPathAsString * " . " * string (path)] = NRevolute
108110 push! (jointStatesRevolute, appendSymbol (path, :phi ))
109111 push! (jointStatesRevolute, appendSymbol (path, :w ))
110112 if jointType == :RevoluteWithFlange
@@ -123,7 +125,7 @@ function buildModia3D!(model::AbstractDict, FloatType::Type, TimeType::Type,
123125 elseif jointType == :Prismatic || jointType == :PrismaticWithFlange
124126 ndofTotal += 1
125127 NPrismatic += 1
126- prismaticIndices[string (path)] = NPrismatic
128+ prismaticIndices[modelPathAsString * " . " * string (path)] = NPrismatic
127129 push! (jointStatesPrismatic, appendSymbol (path, :s ))
128130 push! (jointStatesPrismatic, appendSymbol (path, :v ))
129131 if jointType == :PrismaticWithFlange
@@ -142,7 +144,7 @@ function buildModia3D!(model::AbstractDict, FloatType::Type, TimeType::Type,
142144 elseif jointType == :FreeMotion
143145 ndofTotal += 6
144146 NFreeMotion += 1
145- freeMotionIndices[string (path)] = NFreeMotion
147+ freeMotionIndices[modelPathAsString * " . " * string (path)] = NFreeMotion
146148 push! (jointStatesFreeMotion, appendSymbol (path, :r ))
147149 push! (jointStatesFreeMotion, appendSymbol (path, :v ))
148150 push! (jointStatesFreeMotion, appendSymbol (path, :rot ))
@@ -169,7 +171,6 @@ function buildModia3D!(model::AbstractDict, FloatType::Type, TimeType::Type,
169171
170172 i= 1
171173 mbsi = :_mbs1
172- modelPathAsString = isnothing (modelPath) ? " " : string (modelPath)
173174 mbs_equations = [ :($ mbsi = Modia3D. openModel3D! (instantiatedModel, $ modelPathAsString, $ ndofTotal, time)) ]
174175 mbs_variables = Model ()
175176 mbs_variables[mbsi] = Var (hideResult= true )
0 commit comments