乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 121|回复: 2

[编程交流] C# setting HPNAME not working

[复制链接]

2

主题

3

帖子

1

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 21:47:15 | 显示全部楼层 |阅读模式
I'm trying to update a few system variable in C# based on what button a user selects.  I'm having some issues with the HPNAME system variable.
 
I set the variables like this:
  1. Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("HPNAME", HPNAME);Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("HPSCALE", HPSCALE);Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("HPANG", HPANG);
 
I'm trying to set HPNAME to GRASS, when I step through the code it is correctly trying to set HPNAME to GRASS however nothing happens and the system variable is never changed.  When I manually change HPNAME to GRASS in the command line it works fine.
 
The other two system variables above are correctly changing values.
 
Are there any issues with changing HPNAME?  I have tried hard coding GRASS as well to test but no success.
  1. Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("HPNAME", "GRASS");
 
Thanks,
回复

使用道具 举报

20

主题

338

帖子

323

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 22:26:25 | 显示全部楼层
I tested your code and It appears to be working on my end. Using Civil 3D 2018.
回复

使用道具 举报

2

主题

3

帖子

1

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 22:47:56 | 显示全部楼层
Stupid thing, needed to lock the document to be able to update some of the system variables.  Everything is working now, thanks.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 14:33 , Processed in 0.502346 second(s), 69 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表