Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hola, por trabajo ,deje de trabajar en IPipeFittingAndAccessoryPressureDropServer.Creo que es muy interesante crear un complemento por esa via .Por eso lo volvía retomar.
Solo,por ahora tome IPipeFittingAndAccessoryPressureDropServer,para crear un esquema externo.Pero no se,que pasa,que no lo crea.Que me estas faltando?
Aquí estas el código, si alguien pudiera ayudarme.
Ya estuve mirando el UserMepCalculation,pero ahí no lo crea,aunque si reutilice alguno código.
Hi, because of work, I stopped working on IPipeFittingAndAccessoryPressureDropServer. I think it's very interesting to create a plugin that way. That's why I started it again.
Just, for now, take IPipeFittingAndAccessoryPressureDropServer, to create an external schematic. But I don't know, what happens, that I don't create it. What am I missing?
Here is the code, if someone could help me.
I have already been looking at the UserMepCalculation, but I don't believe it there, although I did reuse some code.
public static class PipeSchemaBuildingUtility
{
internal static readonly Guid LongEquivSchemaGuid = new Guid("EC2B52BE-DAA5-4C29-9230-47847A488A3E");
public static readonly string fieldLongEquiv = "ValorLongitudEquivalente";
internal static Schema BuildSchema(Guid schemaGuid, int version)
{
SchemaBuilder sb = new SchemaBuilder(schemaGuid);
sb.SetReadAccessLevel((AccessLevel)1);
sb.SetWriteAccessLevel((AccessLevel)1);
sb.SetVendorId("USER");
sb.SetDocumentation("Version" + version);
if (schemaGuid.Equals(LongEquivSchemaGuid))
{
sb.SetSchemaName("LongitudEquivalente");
sb.AddSimpleField(fieldLongEquiv, typeof(string));
}
return sb.Finish();
}
}
public class LongitudEquivalentePipeFittingAndAccessoryPressureDropServer : IPipeFittingAndAccessoryPressureDropServer
{
public bool Calculate(PipeFittingAndAccessoryPressureDropData data)
{
if (data == null)
{
return false;
}
Entity val2 = new Entity(GetDataSchema());
string text = "Hola Amigo";
val2.Set<string>(PipeSchemaBuildingUtility.fieldLongEquiv, text);
data.SetDefaultEntity(val2);
return true;
}
public Schema GetDataSchema() => Schema.Lookup(PipeSchemaBuildingUtility.LongEquivSchemaGuid) ?? PipeSchemaBuildingUtility.BuildSchema(PipeSchemaBuildingUtility.LongEquivSchemaGuid, 1);
public string GetDescription() => "Mostrar la Longitud Equivalente";
public string GetName() => "Longitud Equivalente";
public Guid GetServerId() => new Guid("6C46D6B9-DFCC-4C07-B98A-EDD9987EA8BB");
public ExternalServiceId GetServiceId() => ExternalServices.BuiltInExternalServices.PipeFittingAndAccessoryPressureDropService;
public string GetVendorId() => "USER";
public bool IsApplicable(PipeFittingAndAccessoryPressureDropData data) => true;
}
Solved! Go to Solution.