如何更改 Petrel“属性标签”的大小和颜色使用海洋

发布于 2024-11-14 18:42:58 字数 534 浏览 3 评论 0原文

我使用下面的代码向 PolylineSet 添加属性(在 Petrel UI 中,它们被命名为“属性标签”),

using (ITransaction trans = DataManager.NewTransaction())
{
    trans.Lock(polylineSet);
    PolylinePropertyCollection ppc = polylineSet.CreatePropertyCollection();
    trans.Lock(ppc);
    property = ppc.CreateProperty(PetrelProject.WellKnownTemplates.MiscellaneousGroup.General, name);
    trans.Commit();
}

我想更改大小和颜色。 有谁知道这是否可以通过海洋实现?

我想这样做是因为这些标签的大小为 1,颜色为黑色,这对我来说不是一个好的默认值。

提前致谢

I add a property to a PolylineSet using the code below (In the Petrel UI they are named “Attribute labels”)

using (ITransaction trans = DataManager.NewTransaction())
{
    trans.Lock(polylineSet);
    PolylinePropertyCollection ppc = polylineSet.CreatePropertyCollection();
    trans.Lock(ppc);
    property = ppc.CreateProperty(PetrelProject.WellKnownTemplates.MiscellaneousGroup.General, name);
    trans.Commit();
}

I would like to change the size and color.
Does anyone know if this is possible via Ocean?

I want to do this because these labels have a size of 1 and color black and it isn't a good default for me.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

聊慰 2024-11-21 18:42:59

我没有专门更改标签的颜色和大小,但处理了折线集的大小和颜色。也许您可以使用 INumberAnnotation 样式对象?它似乎具有设置字体颜色和大小的属性。

Slb.Ocean.Petrel.UI.Style.IStyleFactory factory = CoreSystem.GetService<Slb.Ocean.Petrel.UI.Style.IStyleFactory>(ppc);
Slb.Ocean.Petrel.UI.Style.INumberAnnotation style = (Slb.Ocean.Petrel.UI.Style.INumberAnnotation)factory.GetStyle(ppc, myWindow);
if (style != null)
{
    style.FontColorType = Slb.Ocean.Petrel.UI.Style.ColorType.White;
    style.FontSize = 400;
}

希望有效。

I haven't specifically altered the color and size of labels, but have dealt with size and color for polylinesets. Maybe you can use the INumberAnnotation style object? It seems to have properties for setting font color and size.

Slb.Ocean.Petrel.UI.Style.IStyleFactory factory = CoreSystem.GetService<Slb.Ocean.Petrel.UI.Style.IStyleFactory>(ppc);
Slb.Ocean.Petrel.UI.Style.INumberAnnotation style = (Slb.Ocean.Petrel.UI.Style.INumberAnnotation)factory.GetStyle(ppc, myWindow);
if (style != null)
{
    style.FontColorType = Slb.Ocean.Petrel.UI.Style.ColorType.White;
    style.FontSize = 400;
}

Hope that works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文