本文整理汇总了C#中ISIS.GME.Dsml.CyPhyML.Interfaces.TryGetResourcePath方法的典型用法代码示例。如果您正苦于以下问题:C# ISIS.GME.Dsml.CyPhyML.Interfaces.TryGetResourcePath方法的具体用法?C# ISIS.GME.Dsml.CyPhyML.Interfaces.TryGetResourcePath怎么用?C# ISIS.GME.Dsml.CyPhyML.Interfaces.TryGetResourcePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISIS.GME.Dsml.CyPhyML.Interfaces
的用法示例。
在下文中一共展示了ISIS.GME.Dsml.CyPhyML.Interfaces.TryGetResourcePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateComponentEditMessage
private Edit CreateComponentEditMessage(string instanceId, CyPhyML.Component component, CyPhyML.CADModel cadModel)
{
string cadModelRelativePath = "";
if (false == cadModel.TryGetResourcePath(out cadModelRelativePath) || cadModelRelativePath == "")
{
// TODO log
//return null;
}
var message = new Edit()
{
editMode = MetaLinkProtobuf.Edit.EditMode.POST,
guid = Guid.NewGuid().ToString(),
//sequence = 0,
};
message.origin.Add(GMEOrigin);
message.topic.Add(instanceId);
edu.vanderbilt.isis.meta.Action action = new edu.vanderbilt.isis.meta.Action();
message.actions.Add(action);
action.actionMode = MetaLinkProtobuf.Action.ActionMode.UPDATE_CAD_COMPONENT;
action.subjectID = component.Attributes.AVMID;
action.environment.Add(new edu.vanderbilt.isis.meta.Environment()
{
name = SearchPathStr,
});
AddSearchPathToEnvironment(component, action.environment[0]);
if (cadModelRelativePath.Length != 0)
{
action.payload = new Payload();
CADComponentType cadComponent = new CADComponentType()
{
AvmComponentID = component.Attributes.AVMID,
CADModelID = CyphyMetaLinkUtils.GetResourceID(cadModel), // Using CADModelID to transport this information (the resource id)
Name = Path.GetFileNameWithoutExtension(cadModelRelativePath), // the partial creo file name (less .prt or .asm)
Type = (Path.GetExtension(cadModelRelativePath).EndsWith(".prt") || Path.GetExtension(cadModelRelativePath).EndsWith(".PRT")) ? "PART" : "ASSEMBLY"
};
foreach (var connector in component.Children.ConnectorCollection)
{
cadComponent.Connectors.Add(new ConnectorType() { ID = connector.Guid.ToString(), DisplayName = connector.Name });
}
foreach (var datum in cadModel.Children.CADDatumCollection)
{
cadComponent.Datums.Add(new ConnectorDatumType() { ID = datum.Attributes.DatumName, DisplayName = datum.Name });
}
action.payload.components.Add(cadComponent);
}
return message;
}