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;
        }