Error:Pop-up Menu 不支持此接口

本文探讨了在Win7系统下使用VC6时遇到的问题,包括与系统的不兼容导致的部分工程无法编译,并提供了解决方案:升级到更高版本的Windows系统,如Windows 10;手动修改文件名去除不必要的后缀;或自己定义菜单资源并处理相关消息。文章旨在帮助开发者解决在不同操作系统环境下使用旧版开发工具时的常见问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Pop-up Menu 不支持此接口,原因是我用的Win7的系统,这就是关键。

1、Win7与VC6不兼容,虽然可以装的上,Win7上可以运行VC6,但是有很多类型的工程是无法编译的,建议升级到10.0。
2、Pop-up Menu后在文件名中将插入组件的后缀.lnk 去掉,将原来的Pop-up Menu.lnk变为Pop-up Menu即可,只是不是很稳定,但是勉强可以使用。
3、自己定义菜单资源,自己处理WM_CONTEXTMENU消息,TrackPopupMenu()。

此原因,多方面是Win7与VC不兼容,若要使用VC6,还是在XP mode吧!
import curses import requests from bs4 import BeautifulSoup from urllib.parse import urljoin import os # 文件路径 FAVORITES_FILE = 'favorites.txt' HISTORY_FILE = 'history.txt' # 加载数据 def load_list(filename): try: with open(filename, 'r', encoding='utf-8') as f: return [line.strip() for line in f if line.strip()] except FileNotFoundError: return [] # 保存数据 def save_list(filename, items): with open(filename, 'w', encoding='utf-8') as f: for item in items: f.write(item + '\n') # 获取网页纯文本 def fetch_page(url): try: res = requests.get(url, timeout=5) res.raise_for_status() soup = BeautifulSoup(res.text, 'html.parser') for tag in soup(['script', 'style']): tag.decompose() return soup.get_text() except Exception as e: return f"加载失败: {e}" # 提取超链接和表单(扩展版) def extract_links_and_forms(html, base_url): soup = BeautifulSoup(html, 'html.parser') # 提取超链接 links = [] for a in soup.find_all('a', href=True): href = a['href'] if not href.startswith('http'): href = urljoin(base_url, href) links.append((href, a.get_text(strip=True))) # 提取表单 forms = [] for form in soup.find_all('form'): action = form.get('action', '') if not action.startswith('http'): action = urljoin(base_url, action) method = form.get('method', 'get').lower() inputs = [] # 提取所有输入字段 for input_tag in form.find_all(['input', 'textarea', 'select']): name = input_tag.get('name') if not name: continue input_type = input_tag.get('type', 'text') value = input_tag.get('value', '') required = input_tag.has_attr('required') placeholder = input_tag.get('placeholder', '') if input_tag.name == 'textarea': input_type = 'textarea' value = input_tag.get_text() elif input_tag.name == 'select': input_type = 'select' options = [(opt.get('value') or opt.text, opt.text) for opt in input_tag.find_all('option')] inputs.append({ 'name': name, 'type': input_type, 'value': value, 'required': required, 'placeholder': placeholder, 'options': options }) continue # 处理 checkbox 和 radio if input_type == 'checkbox' or input_type == 'radio': inputs.append({ 'name': name, 'type': input_type, 'value': value, 'checked': input_tag.has_attr('checked'), 'required': required }) continue inputs.append({ 'name': name, 'type': input_type, 'value': value, 'required': required, 'placeholder': placeholder }) forms.append((action, method, inputs)) return links, forms # 输入框 def input_box(stdscr, prompt): curses.echo() stdscr.clear() stdscr.addstr(0, 0, prompt) stdscr.refresh() input_str = stdscr.getstr(1, 0).decode('utf-8') curses.noecho() return input_str # 提交表单(扩展版) def submit_form(stdscr, form): action, method, inputs = form data = {} for field in inputs: name = field['name'] input_type = field['type'] required = field.get('required', False) placeholder = field.get('placeholder', '') value = field.get('value', '') prompt = f"{name}" if placeholder: prompt += f"(提示:{placeholder})" if required: prompt += " [必填]" if input_type == 'select': options = field['options'] stdscr.clear() stdscr.addstr(0, 0, f"请选择 {name}:") for i, (val, text) in enumerate(options): stdscr.addstr(i + 1, 0, f"{i + 1}. {text}") stdscr.refresh() idx = int(stdscr.getstr(len(options) + 2, 0).decode('utf-8')) - 1 data[name] = options[idx][0] elif input_type == 'checkbox': checked = field.get('checked', False) res = input_box(stdscr, f"{name} [复选框] 是否选中?(y/n):") data[name] = 'on' if res.lower() == 'y' else '' elif input_type == 'radio': res = input_box(stdscr, f"{name} [单选] 是否选中?(y/n):") data[name] = value if res.lower() == 'y' else '' else: default = value if value else '' user_input = input_box(stdscr, f"{prompt}:") data[name] = user_input if user_input else default try: if method == 'post': res = requests.post(action, data=data) else: res = requests.get(action, params=data) return res.text except Exception as e: return f"表单提交失败:{e}" # 收藏夹菜单 def favorites_menu(stdscr, favorites, current_url): while True: options = ["新添", "删除", "退出"] action = show_list(stdscr, options, "收藏夹", options) if action == 0: # 新添 if current_url not in favorites: favorites.append(current_url) save_list(FAVORITES_FILE, favorites) elif action == 1: # 删除 if favorites: idx = show_list(stdscr, favorites, "选择要删除的收藏") if idx >= 0: favorites.pop(idx) save_list(FAVORITES_FILE, favorites) elif action == 2 or action == -1: break # 历史记录菜单 def history_menu(stdscr, history): while True: options = ["清空", "退出"] action = show_list(stdscr, options, "历史记录", options) if action == 0: # 清空 history.clear() save_list(HISTORY_FILE, history) elif action == 1 or action == -1: break elif action >= 0: return history[action] return None # 显示列表(收藏夹/历史记录) def show_list(stdscr, items, title, actions=None): selected = 0 while True: stdscr.clear() stdscr.addstr(0, 0, title) if actions: stdscr.addstr(0, len(title) + 2, f"| {' | '.join(actions)}") stdscr.addstr(1, 0, "-" * 50) for i, item in enumerate(items): if i == selected: stdscr.attron(curses.A_REVERSE) stdscr.addstr(i + 2, 0, f"{i + 1}. {item}") if i == selected: stdscr.attroff(curses.A_REVERSE) stdscr.addstr(len(items) + 3, 0, "方向键选择,Enter确认,q退出") stdscr.refresh() key = stdscr.getch() if key == curses.KEY_UP and selected > 0: selected -= 1 elif key == curses.KEY_DOWN and selected < len(items) - 1: selected += 1 elif key == ord('\n'): return selected elif key == ord('q'): return -1 def main(stdscr): curses.curs_set(0) # 隐藏光标 favorites = load_list(FAVORITES_FILE) history = load_list(HISTORY_FILE) # 初始页面加载 current_url = input_box(stdscr, "请输入网址:") page_text = fetch_page(current_url) if current_url not in history: history.append(current_url) if len(history) > 20: history.pop(0) save_list(HISTORY_FILE, history) # 初始数据 menu_options = ["收藏夹", "新的网页", "历史记录"] selected_menu = 0 links, forms = extract_links_and_forms(page_text, current_url) selected_link = 0 selected_form = 0 mode = "menu" # 当前模式:menu, link, form while True: stdscr.clear() h, w = stdscr.getmaxyx() # 显示顶部菜单 for i, opt in enumerate(menu_options): x = 2 + i * 15 if mode == "menu" and i == selected_menu: stdscr.attron(curses.A_REVERSE) stdscr.addstr(0, x, opt) if mode == "menu" and i == selected_menu: stdscr.attroff(curses.A_REVERSE) stdscr.addstr(1, 0, "-" * w) # 显示网页内容 lines = page_text.split('\n') for i, line in enumerate(lines[:h - 10]): stdscr.addstr(i + 2, 0, line[:w - 1]) # 显示超链接 stdscr.addstr(h - 8, 0, "超链接:") for i, (url, text) in enumerate(links): label = f"{i + 1}. {text[:30]}..." if mode == "link" and i == selected_link: stdscr.attron(curses.A_REVERSE) stdscr.addstr(h - 7 + i, 0, label[:w - 1]) if mode == "link" and i == selected_link: stdscr.attroff(curses.A_REVERSE) # 显示表单 stdscr.addstr(h - 7 + len(links) + 1, 0, "表单:") for i, (action, method, inputs) in enumerate(forms): label = f"表单 {i + 1}: {method.upper()} {action[:30]}..." if mode == "form" and i == selected_form: stdscr.attron(curses.A_REVERSE) stdscr.addstr(h - 6 + len(links) + i + 1, 0, label[:w - 1]) if mode == "form" and i == selected_form: stdscr.attroff(curses.A_REVERSE) # 底部提示 stdscr.addstr(h - 1, 0, "方向键选择,Enter确认,q返回,Tab切换区域") stdscr.refresh() # 用户输入处理 key = stdscr.getch() if key == ord('q'): break elif key == ord('\t'): # 切换模式:菜单 -> 链接 -> 表单 -> 菜单 if mode == "menu": mode = "link" elif mode == "link": mode = "form" else: mode = "menu" elif key == curses.KEY_UP: if mode == "menu" and selected_menu > 0: selected_menu -= 1 elif mode == "link" and selected_link > 0: selected_link -= 1 elif mode == "form" and selected_form > 0: selected_form -= 1 elif key == curses.KEY_DOWN: if mode == "menu" and selected_menu < len(menu_options) - 1: selected_menu += 1 elif mode == "link" and selected_link < len(links) - 1: selected_link += 1 elif mode == "form" and selected_form < len(forms) - 1: selected_form += 1 elif key == ord('\n'): if mode == "menu": if selected_menu == 0: favorites_menu(stdscr, favorites, current_url) elif selected_menu == 1: current_url = input_box(stdscr, "请输入网址:") page_text = fetch_page(current_url) if current_url not in history: history.append(current_url) if len(history) > 20: history.pop(0) save_list(HISTORY_FILE, history) links, forms = extract_links_and_forms(page_text, current_url) elif selected_menu == 2: selected_url = history_menu(stdscr, history) if selected_url: current_url = selected_url page_text = fetch_page(current_url) links, forms = extract_links_and_forms(page_text, current_url) elif mode == "link": if links: current_url = links[selected_link][0] page_text = fetch_page(current_url) links, forms = extract_links_and_forms(page_text, current_url) elif mode == "form": if forms: result = submit_form(stdscr, forms[selected_form]) page_text = result links, forms = extract_links_and_forms(page_text, current_url) return # 启动程序 if __name__ == "__main__": curses.wrapper(main) 这是我的纯文本浏览器的源代码。它报错了:Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. = RESTART: C:\Users\number one\Desktop\纯文本浏览器.py Traceback (most recent call last): File "C:\Users\number one\Desktop\纯文本浏览器.py", line 363, in <module> curses.wrapper(main) File "C:\Users\number one\AppData\Local\Programs\Python\Python311\Lib\curses\__init__.py", line 73, in wrapper stdscr = initscr() File "C:\Users\number one\AppData\Local\Programs\Python\Python311\Lib\curses\__init__.py", line 30, in initscr fd=_sys.__stdout__.fileno()) AttributeError: 'NoneType' object has no attribute 'fileno'
07-12
我正在学习NX二次开发,用的是Visual Studio 2019,ug版本是12.0,开发平台是c++,uf函数为主nxopen函数为辅。需要你辅助我开发,重点注意开发模版是c++,优先使用uf函数,要求你先搞清楚你提供给我的代码真实有效性,语句与标点符号的正确位置,避免出现ug12.0没有提供的接口成员出现!确保所有方法调用都符合 NX12 的 API 签名,深度思考下再回答,每次回答前先回顾下前面的所有对话避免问题重复出现,每行代码都用中文注解具体意思与作用。 //============================================================================== // WARNING!! This file is overwritten by the Block UI Styler while generating // the automation code. Any modifications to this file will be lost after // generating the code again. // // Filename: D:\NXopen\BaiduSyncdisk\studio\qiaowei_tool\ui\qiaowei_tool.cpp // // This file was generated by the NX Block UI Styler // Created by: MICH-ROG // Version: NX 12 // Date: 08-07-2025 (Format: mm-dd-yyyy) // Time: 21:38 (Format: hh-mm) // //============================================================================== //============================================================================== // Purpose: This TEMPLATE file contains C++ source to guide you in the // construction of your Block application dialog. The generation of your // dialog file (.dlx extension) is the first step towards dialog construction // within NX. You must now create a NX Open application that // utilizes this file (.dlx). // // The information in this file provides you with the following: // // 1. Help on how to load and display your Block UI Styler dialog in NX // using APIs provided in NXOpen.BlockStyler namespace // 2. The empty callback methods (stubs) associated with your dialog items // have also been placed in this file. These empty methods have been // created simply to start you along with your coding requirements. // The method name, argument list and possible return values have already // been provided for you. //============================================================================== //------------------------------------------------------------------------------ //These includes are needed for the following template code //------------------------------------------------------------------------------ #include "qiaowei_tool.hpp" using namespace NXOpen; using namespace NXOpen::BlockStyler; //------------------------------------------------------------------------------ // Initialize static variables //------------------------------------------------------------------------------ Session *(qiaowei_tool::theSession) = NULL; UI *(qiaowei_tool::theUI) = NULL; //------------------------------------------------------------------------------ // Constructor for NX Styler class //------------------------------------------------------------------------------ qiaowei_tool::qiaowei_tool() { try { // Initialize the NX Open C++ API environment qiaowei_tool::theSession = NXOpen::Session::GetSession(); qiaowei_tool::theUI = UI::GetUI(); theDlxFileName = "qiaowei_tool.dlx"; theDialog = qiaowei_tool::theUI->CreateDialog(theDlxFileName); // Registration of callback functions theDialog->AddApplyHandler(make_callback(this, &qiaowei_tool::apply_cb)); theDialog->AddOkHandler(make_callback(this, &qiaowei_tool::ok_cb)); theDialog->AddUpdateHandler(make_callback(this, &qiaowei_tool::update_cb)); theDialog->AddInitializeHandler(make_callback(this, &qiaowei_tool::initialize_cb)); theDialog->AddDialogShownHandler(make_callback(this, &qiaowei_tool::dialogShown_cb)); } catch(exception& ex) { //---- Enter your exception handling code here ----- throw; } } //------------------------------------------------------------------------------ // Destructor for NX Styler class //------------------------------------------------------------------------------ qiaowei_tool::~qiaowei_tool() { if (theDialog != NULL) { delete theDialog; theDialog = NULL; } } //------------------------------- DIALOG LAUNCHING --------------------------------- // // Before invoking this application one needs to open any part/empty part in NX // because of the behavior of the blocks. // // Make sure the dlx file is in one of the following locations: // 1.) From where NX session is launched // 2.) $UGII_USER_DIR/application // 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat // // You can create the dialog using one of the following way: // // 1. USER EXIT // // 1) Create the Shared Library -- Refer "Block UI Styler programmer's guide" // 2) Invoke the Shared Library through File->Execute->NX Open menu. // //------------------------------------------------------------------------------ extern "C" DllExport void ufusr(char *param, int *retcod, int param_len) { qiaowei_tool *theqiaowei_tool = NULL; try { UF_initialize(); //开发的许可函数,初始化 theqiaowei_tool = new qiaowei_tool(); // The following method shows the dialog immediately theqiaowei_tool->Show(); } catch(exception& ex) { //---- Enter your exception handling code here ----- qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } if(theqiaowei_tool != NULL) { delete theqiaowei_tool; theqiaowei_tool = NULL; }UF_terminate(); //释放许可函数,结束化 } //------------------------------------------------------------------------------ // This method specifies how a shared image is unloaded from memory // within NX. This method gives you the capability to unload an // internal NX Open application or user exit from NX. Specify any // one of the three constants as a return value to determine the type // of unload to perform: // // // Immediately : unload the library as soon as the automation program has completed // Explicitly : unload the library from the "Unload Shared Image" dialog // AtTermination : unload the library when the NX session terminates // // // NOTE: A program which associates NX Open applications with the menubar // MUST NOT use this option since it will UNLOAD your NX Open application image // from the menubar. //------------------------------------------------------------------------------ extern "C" DllExport int ufusr_ask_unload() { //return (int)Session::LibraryUnloadOptionExplicitly; return (int)Session::LibraryUnloadOptionImmediately; //return (int)Session::LibraryUnloadOptionAtTermination; } //------------------------------------------------------------------------------ // Following method cleanup any housekeeping chores that may be needed. // This method is automatically called by NX. //------------------------------------------------------------------------------ extern "C" DllExport void ufusr_cleanup(void) { try { //---- Enter your callback code here ----- } catch(exception& ex) { //---- Enter your exception handling code here ----- qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } } int qiaowei_tool::Show() { try { theDialog->Show(); } catch(exception& ex) { //---- Enter your exception handling code here ----- qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } return 0; } //------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ void qiaowei_tool::initialize_cb() { try { group0 = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group0")); bianjie_edge = dynamic_cast<NXOpen::BlockStyler::CurveCollector*>(theDialog->TopBlock()->FindBlock("bianjie_edge")); chuliao_edge = dynamic_cast<NXOpen::BlockStyler::CurveCollector*>(theDialog->TopBlock()->FindBlock("chuliao_edge")); group = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group")); expression_clcq = dynamic_cast<NXOpen::BlockStyler::ExpressionBlock*>(theDialog->TopBlock()->FindBlock("expression_clcq")); expression_smh = dynamic_cast<NXOpen::BlockStyler::ExpressionBlock*>(theDialog->TopBlock()->FindBlock("expression_smh")); expression_jlcq = dynamic_cast<NXOpen::BlockStyler::ExpressionBlock*>(theDialog->TopBlock()->FindBlock("expression_jlcq")); expression_dqjiaodu = dynamic_cast<NXOpen::BlockStyler::ExpressionBlock*>(theDialog->TopBlock()->FindBlock("expression_dqjiaodu")); group1 = dynamic_cast<NXOpen::BlockStyler::Group*>(theDialog->TopBlock()->FindBlock("group1")); toggle_daojiao = dynamic_cast<NXOpen::BlockStyler::Toggle*>(theDialog->TopBlock()->FindBlock("toggle_daojiao")); expression_rjiao = dynamic_cast<NXOpen::BlockStyler::ExpressionBlock*>(theDialog->TopBlock()->FindBlock("expression_rjiao")); toggle_pianzhi = dynamic_cast<NXOpen::BlockStyler::Toggle*>(theDialog->TopBlock()->FindBlock("toggle_pianzhi")); expression_pianzhi = dynamic_cast<NXOpen::BlockStyler::ExpressionBlock*>(theDialog->TopBlock()->FindBlock("expression_pianzhi")); vector0 = dynamic_cast<NXOpen::BlockStyler::SpecifyVector*>(theDialog->TopBlock()->FindBlock("vector0")); } catch(exception& ex) { //---- Enter your exception handling code here ----- qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } } //------------------------------------------------------------------------------ //Callback Name: dialogShown_cb //This callback is executed just before the dialog launch. Thus any value set //here will take precedence and dialog will be launched showing that value. //------------------------------------------------------------------------------ void qiaowei_tool::dialogShown_cb() { try { //---- Enter your callback code here ----- } catch(exception& ex) { //---- Enter your exception handling code here ----- qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } } //------------------------------------------------------------------------------ //Callback Name: apply_cb //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: apply_cb // // 应用按钮回调函数 //------------------------------------------------------------------------------ int qiaowei_tool::apply_cb() { int errorCode = 0; // 错误代码,0表示成功 try { // 获取NX会话和工作部件 NXOpen::Session* theSession = NXOpen::Session::GetSession(); NXOpen::Part* workPart = theSession->Parts()->Work(); NXOpen::UI* theUI = NXOpen::UI::GetUI(); // ===== 1. 获取边界边曲线 ===== std::vector<NXOpen::Curve*> boundaryCurves; if (bianjie_edge) { // 获取曲线选择器属性列表 std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(bianjie_edge->GetProperties()); // 获取选中的对象集合 std::vector<NXOpen::TaggedObject*> selObjs = props->GetTaggedObjectVector("SelectedObjects"); // 遍历选中对象并转换为曲线 for (NXOpen::TaggedObject* obj : selObjs) { if (NXOpen::Curve* curve = dynamic_cast<NXOpen::Curve*>(obj)) { boundaryCurves.push_back(curve); } } } // ===== 2. 获取出料边曲线 ===== std::vector<NXOpen::Curve*> dischargeCurves; if (chuliao_edge) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(chuliao_edge->GetProperties()); std::vector<NXOpen::TaggedObject*> selObjs = props->GetTaggedObjectVector("SelectedObjects"); for (NXOpen::TaggedObject* obj : selObjs) { if (NXOpen::Curve* curve = dynamic_cast<NXOpen::Curve*>(obj)) { dischargeCurves.push_back(curve); } } } // ===== 3. 获取出料沉桥值 ===== double materialThickness = 0.0; if (expression_clcq) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(expression_clcq->GetProperties()); // 获取表达式数值 materialThickness = props->GetDouble("Value"); } // ===== 4. 获取上模厚度值 ===== double scanHeight = 0.0; if (expression_smh) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(expression_smh->GetProperties()); scanHeight = props->GetDouble("Value"); } // ===== 5. 获取进料沉桥值 ===== double clearanceValue = 0.0; if (expression_jlcq) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(expression_jlcq->GetProperties()); clearanceValue = props->GetDouble("Value"); } // ===== 6. 获取倒桥角度值 ===== double currentAngle = 0.0; if (expression_dqjiaodu) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(expression_dqjiaodu->GetProperties()); currentAngle = props->GetDouble("Value"); } // ===== 7. 获取倒角开关状态 ===== bool chamferToggle = false; if (toggle_daojiao) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(toggle_daojiao->GetProperties()); // 获取开关状态(选中/未选中) chamferToggle = props->GetLogical("Value"); } // ===== 8. 获取倒角半径值 ===== double chamferRadius = 0.0; if (expression_rjiao && chamferToggle) // 仅在倒角开启时获取 { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(expression_rjiao->GetProperties()); chamferRadius = props->GetDouble("Value"); } // ===== 9. 获取偏移开关状态 ===== bool offsetToggle = false; if (toggle_pianzhi) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(toggle_pianzhi->GetProperties()); offsetToggle = props->GetLogical("Value"); } // ===== 10. 获取偏移距离值 ===== double offsetDistance = 0.0; if (expression_pianzhi && offsetToggle) // 仅在偏移开启时获取 { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(expression_pianzhi->GetProperties()); offsetDistance = props->GetDouble("Value"); } // ===== 11. 获取矢量方向 ===== NXOpen::Vector3d directionVector(0.0, 0.0, 1.0); // 默认Z轴方向 if (vector0) { std::unique_ptr<NXOpen::BlockStyler::PropertyList> props(vector0->GetProperties()); // 获取用户指定的矢量方向 directionVector = props->GetVector("Vector"); } // ===== 12. 验证必要输入 ===== if (boundaryCurves.size() < 2) { throw std::runtime_error("需要选择两条桥位边界曲线!"); } if (dischargeCurves.empty()) { throw std::runtime_error("出料边曲线未选择!"); } if (scanHeight <= 0) { throw std::runtime_error("上模厚度必须大于0!"); } // ===== 13. 计算两条边界曲线端点间的最短距离并创建两条连接直线 ===== tag_t line1Tag = NULL_TAG; tag_t line2Tag = NULL_TAG; double minDist = 0.0; double remainingDist = 0.0; try { // 获取前两条边界曲线 NXOpen::Curve* curve1 = boundaryCurves[0]; NXOpen::Curve* curve2 = boundaryCurves[1]; // 获取曲线端点 double curve1Start[3] = { 0.0 }, curve1End[3] = { 0.0 }; double curve2Start[3] = { 0.0 }, curve2End[3] = { 0.0 }; // 获取曲线1端点 UF_EVAL_p_t evaluator1 = NULL; if (UF_EVAL_initialize(curve1->Tag(), &evaluator1) != 0) { throw std::runtime_error("无法初始化曲线1的评估器"); } double limits1[2]; if (UF_EVAL_ask_limits(evaluator1, limits1) != 0) { UF_EVAL_free(evaluator1); throw std::runtime_error("无法获取曲线1的参数范围"); } if (limits1[0] > limits1[1]) std::swap(limits1[0], limits1[1]); if (UF_EVAL_evaluate(evaluator1, 0, limits1[0], curve1Start, NULL) != 0 || UF_EVAL_evaluate(evaluator1, 0, limits1[1], curve1End, NULL) != 0) { UF_EVAL_free(evaluator1); throw std::runtime_error("无法评估曲线1的端点"); } UF_EVAL_free(evaluator1); // 获取曲线2端点 UF_EVAL_p_t evaluator2 = NULL; if (UF_EVAL_initialize(curve2->Tag(), &evaluator2) != 0) { throw std::runtime_error("无法初始化曲线2的评估器"); } double limits2[2]; if (UF_EVAL_ask_limits(evaluator2, limits2) != 0) { UF_EVAL_free(evaluator2); throw std::runtime_error("无法获取曲线2的参数范围"); } if (limits2[0] > limits2[1]) std::swap(limits2[0], limits2[1]); if (UF_EVAL_evaluate(evaluator2, 0, limits2[0], curve2Start, NULL) != 0 || UF_EVAL_evaluate(evaluator2, 0, limits2[1], curve2End, NULL) != 0) { UF_EVAL_free(evaluator2); throw std::runtime_error("无法评估曲线2的端点"); } UF_EVAL_free(evaluator2); // 转换为NXOpen点对象 NXOpen::Point3d p1_start(curve1Start[0], curve1Start[1], curve1Start[2]); NXOpen::Point3d p1_end(curve1End[0], curve1End[1], curve1End[2]); NXOpen::Point3d p2_start(curve2Start[0], curve2Start[1], curve2Start[2]); NXOpen::Point3d p2_end(curve2End[0], curve2End[1], curve2End[2]); // 计算两点间距离的函数 auto distance = [](const NXOpen::Point3d& a, const NXOpen::Point3d& b) -> double { return sqrt(pow(a.X - b.X, 2) + pow(a.Y - b.Y, 2) + pow(a.Z - b.Z, 2)); }; // 计算四种可能的端点组合距离 double dist1 = distance(p1_start, p2_start); double dist2 = distance(p1_start, p2_end); double dist3 = distance(p1_end, p2_start); double dist4 = distance(p1_end, p2_end); // 找出最小距离对应的点对 minDist = std::min({ dist1, dist2, dist3, dist4 }); NXOpen::Point3d minPoint1, minPoint2; int minIndex = 0; if (minDist == dist1) { minPoint1 = p1_start; minPoint2 = p2_start; } else if (minDist == dist2) { minPoint1 = p1_start; minPoint2 = p2_end; } else if (minDist == dist3) { minPoint1 = p1_end; minPoint2 = p2_start; } else { minPoint1 = p1_end; minPoint2 = p2_end; } // 确定剩余的两个端点 auto isPointEqual = [](const NXOpen::Point3d& a, const NXOpen::Point3d& b, double tol = 1e-6) -> bool { return (fabs(a.X - b.X) < tol) && (fabs(a.Y - b.Y) < tol) && (fabs(a.Z - b.Z) < tol); }; NXOpen::Point3d remainingPoint1 = isPointEqual(minPoint1, p1_start) ? p1_end : p1_start; NXOpen::Point3d remainingPoint2 = isPointEqual(minPoint2, p2_start) ? p2_end : p2_start; remainingDist = distance(remainingPoint1, remainingPoint2); // ===== 创建两条连接直线 ===== // 创建第一条直线(最短距离连接) UF_CURVE_line_t line1Coords; line1Coords.start_point[0] = minPoint1.X; line1Coords.start_point[1] = minPoint1.Y; line1Coords.start_point[2] = minPoint1.Z; line1Coords.end_point[0] = minPoint2.X; line1Coords.end_point[1] = minPoint2.Y; line1Coords.end_point[2] = minPoint2.Z; if (UF_CURVE_create_line(&line1Coords, &line1Tag) != 0 || line1Tag == NULL_TAG) { throw std::runtime_error("创建最短距离直线失败"); } // 设置第一条直线属性 int workLayer = workPart->Layers()->WorkLayer(); UF_OBJ_set_layer(line1Tag, workLayer); // 创建第二条直线(剩余端点连接) UF_CURVE_line_t line2Coords; line2Coords.start_point[0] = remainingPoint1.X; line2Coords.start_point[1] = remainingPoint1.Y; line2Coords.start_point[2] = remainingPoint1.Z; line2Coords.end_point[0] = remainingPoint2.X; line2Coords.end_point[1] = remainingPoint2.Y; line2Coords.end_point[2] = remainingPoint2.Z; if (UF_CURVE_create_line(&line2Coords, &line2Tag) != 0 || line2Tag == NULL_TAG) { throw std::runtime_error("创建剩余端点直线失败"); } // 设置第二条直线属性 UF_OBJ_set_layer(line2Tag, workLayer); // 更新显示 UF_DISP_refresh(); // 显示成功信息 char msg[256]; snprintf(msg, sizeof(msg), "已创建两条连接直线:\n" "1. 最短距离直线: %.2f mm\n" "2. 剩余端点直线: %.2f mm", minDist, remainingDist); theUI->NXMessageBox()->Show("操作成功", NXOpen::NXMessageBox::DialogTypeInformation, msg); } catch (std::exception& ex) { char errMsg[256]; snprintf(errMsg, sizeof(errMsg), "端点距离计算或直线创建失败: %s", ex.what()); theUI->NXMessageBox()->Show("错误", NXOpen::NXMessageBox::DialogTypeError, errMsg); errorCode = 2; return errorCode; // 提前返回,不再继续后续操作 } // ===== 14. 创建拉伸特征(新建体) ===== try { // 设置撤销标记 NXOpen::Session::UndoMarkId markId = theSession->SetUndoMark( NXOpen::Session::MarkVisibilityVisible, "桥位拉伸"); // 创建拉伸构建器 NXOpen::Features::ExtrudeBuilder* extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(nullptr); // 创建截面 NXOpen::Section* section = workPart->Sections()->CreateSection( 0.001, 0.001, 0.05); extrudeBuilder->SetSection(section); // 准备截面曲线:边界曲线 + 连接直线 std::vector<NXOpen::Curve*> sectionCurves; sectionCurves.push_back(boundaryCurves[0]); sectionCurves.push_back(boundaryCurves[1]); // 将直线标签转换为曲线对象 NXOpen::Curve* line1Curve = dynamic_cast<NXOpen::Curve*>( NXOpen::NXObjectManager::Get(line1Tag)); NXOpen::Curve* line2Curve = dynamic_cast<NXOpen::Curve*>( NXOpen::NXObjectManager::Get(line2Tag)); if (line1Curve) sectionCurves.push_back(line1Curve); if (line2Curve) sectionCurves.push_back(line2Curve); // 创建曲线规则 std::vector<NXOpen::SelectionIntentRule*> rules; if (!sectionCurves.empty()) { NXOpen::SelectionIntentRule* curveRule = workPart->ScRuleFactory()->CreateRuleCurveDumb(sectionCurves); rules.push_back(curveRule); } // 获取帮助点(中点) NXOpen::Point3d helpPoint(0.0, 0.0, 0.0); if (!sectionCurves.empty()) { tag_t curveTag = sectionCurves[0]->Tag(); UF_EVAL_p_t evaluator = NULL; double limits[2]; if (UF_EVAL_initialize(curveTag, &evaluator) == 0) { if (UF_EVAL_ask_limits(evaluator, limits) == 0) { if (limits[0] > limits[1]) std::swap(limits[0], limits[1]); double midParam = (limits[0] + limits[1]) / 2.0; double midPoint[3]; if (UF_EVAL_evaluate(evaluator, 0, midParam, midPoint, NULL) == 0) { helpPoint = NXOpen::Point3d(midPoint[0], midPoint[1], midPoint[2]); } } UF_EVAL_free(evaluator); } } // 添加到截面 section->AddToSection( rules, sectionCurves[0], NULL, NULL, helpPoint, NXOpen::Section::ModeCreate ); // 设置拉伸方向 NXOpen::Point3d origin(0.0, 0.0, 0.0); NXOpen::Direction* extrudeDirection = workPart->Directions()->CreateDirection( origin, directionVector, NXOpen::SmartObject::UpdateOptionWithinModeling ); extrudeBuilder->SetDirection(extrudeDirection); // 设置拉伸范围 NXOpen::GeometricUtilities::Limits* limits = extrudeBuilder->Limits(); limits->StartExtend()->Value()->SetRightHandSide( std::to_string(materialThickness).c_str()); double endDistance = scanHeight - clearanceValue; limits->EndExtend()->Value()->SetRightHandSide( std::to_string(endDistance).c_str()); // ===== 设置布尔操作为新建体 ===== extrudeBuilder->BooleanOperation()->SetType( NXOpen::GeometricUtilities::BooleanOperation::BooleanTypeCreate); // 执行拉伸操作 NXOpen::NXObject* featureNXObject = nullptr; std::vector<NXOpen::Body*> resultBodies; try { // 提交拉伸操作 featureNXObject = extrudeBuilder->Commit(); // 将特征对象转换为Feature类型 NXOpen::Features::Feature* extrudeFeature = dynamic_cast<NXOpen::Features::Feature*>(featureNXObject); if (extrudeFeature) { // 正确获取拉伸创建的实体 resultBodies = extrudeFeature->GetBodies(); } else { throw std::runtime_error("拉伸特征创建失败"); } // 显示结果信息 char successMsg[256]; if (!resultBodies.empty()) { snprintf(successMsg, sizeof(successMsg), "创建新实体成功!\n实体数量: %d\n起始距离: %.2f mm\n结束距离: %.2f mm", resultBodies.size(), materialThickness, endDistance); } else { snprintf(successMsg, sizeof(successMsg), "拉伸操作完成但未创建实体!\n起始距离: %.2f mm\n结束距离: %.2f mm", materialThickness, endDistance); } theUI->NXMessageBox()->Show("操作结果", NXOpen::NXMessageBox::DialogTypeInformation, successMsg); // 清理资源 extrudeBuilder->Destroy(); section->Destroy(); } catch (std::exception& ex) { char errMsg[256]; snprintf(errMsg, sizeof(errMsg), "创建拉伸特征失败: %s", ex.what()); theUI->NXMessageBox()->Show("错误", NXOpen::NXMessageBox::DialogTypeError, errMsg); errorCode = 3; // 特殊错误处理:当布尔操作设置可能冲突时 if (std::string(ex.what()).find("boolean") != std::string::npos) { theUI->NXMessageBox()->Show("布尔操作错误", NXOpen::NXMessageBox::DialogTypeError, "请检查布尔操作设置是否与现有几何冲突"); errorCode = 4; } // 确保资源被清理 if (extrudeBuilder) { extrudeBuilder->Destroy(); } if (section) { section->Destroy(); } } // ===== 最终清理和返回 ===== // 删除临时创建的直线 if (line1Tag != NULL_TAG) { UF_OBJ_delete_object(line1Tag); } if (line2Tag != NULL_TAG) { UF_OBJ_delete_object(line2Tag); } // 刷新显示 UF_DISP_refresh(); return errorCode; } // 注意:这里是apply_cb函数的结束括号 //------------------------------------------------------------------------------ //Callback Name: update_cb //------------------------------------------------------------------------------ int qiaowei_tool::update_cb(NXOpen::BlockStyler::UIBlock* block) { try { if(block == bianjie_edge) { //---------Enter your code here----------- } else if(block == chuliao_edge) { //---------Enter your code here----------- } else if(block == expression_clcq) { //---------Enter your code here----------- } else if(block == expression_smh) { //---------Enter your code here----------- } else if(block == expression_jlcq) { //---------Enter your code here----------- } else if(block == expression_dqjiaodu) { //---------Enter your code here----------- } else if(block == toggle_daojiao) { //---------Enter your code here----------- } else if(block == expression_rjiao) { //---------Enter your code here----------- } else if(block == toggle_pianzhi) { //---------Enter your code here----------- } else if(block == expression_pianzhi) { //---------Enter your code here----------- } else if(block == vector0) { //---------Enter your code here----------- } } catch(exception& ex) { //---- Enter your exception handling code here ----- qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } return 0; } //------------------------------------------------------------------------------ //Callback Name: ok_cb //------------------------------------------------------------------------------ int qiaowei_tool::ok_cb() { int errorCode = 0; try { errorCode = apply_cb(); } catch(exception& ex) { //---- Enter your exception handling code here ----- errorCode = 1; qiaowei_tool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } return errorCode; } //------------------------------------------------------------------------------ //Function Name: GetBlockProperties //Description: Returns the propertylist of the specified BlockID //------------------------------------------------------------------------------ PropertyList* qiaowei_tool::GetBlockProperties(const char *blockID) { return theDialog->GetBlockProperties(blockID); } 以上代码报错:严重性 代码 说明 项目 文件 行 禁止显示状态 错误(活动) E0530 try 块至少需要一个处理程序 qiaowei_tool D:\NXopen\BaiduSyncdisk\studio\qiaowei_tool\qiaowei_tool.cpp 694 错误(活动) E0135 class "NXOpen::Features::Feature" 没有成员 "GetBodies" qiaowei_tool D:\NXopen\BaiduSyncdisk\studio\qiaowei_tool\qiaowei_tool.cpp 623 出错部分参考以下帮助文档:#ifndef NXOpen_FEATURES_FEATURE_HXX_INCLUDED #define NXOpen_FEATURES_FEATURE_HXX_INCLUDED //-------------------------------------------------------------------------- // Header for C++ interface to JA API //-------------------------------------------------------------------------- // // Source File: // Features_Feature.ja // // Generated by: // apiwrap // // WARNING: // This file is automatically generated - do not edit by hand // #ifdef _MSC_VER #pragma once #endif #include <NXOpen/NXDeprecation.hxx> #include <vector> #include <NXOpen/NXString.hxx> #include <NXOpen/Callback.hxx> #include <NXOpen/IFitTo.hxx> #include <NXOpen/INXObject.hxx> #include <NXOpen/IProfile.hxx> #include <NXOpen/NXObject.hxx> #include <NXOpen/ugmath.hxx> #include <NXOpen/libnxopencpp_features_exports.hxx> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4996) #endif #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif namespace NXOpen { namespace Features { class Feature; } namespace Assemblies { class Component; } class BasePart; class Expression; namespace Features { class IContainerFeature; } class IFitTo; class INXObject; class IProfile; class NXColor; class NXObject; class Section; namespace Features { class _FeatureBuilder; class FeatureImpl; /** Represents a feature on a part <br> This is an abstract class, and cannot be instantiated. <br> <br> Created in NX3.0.0. <br> */ class NXOPENCPP_FEATURESEXPORT Feature : public NXOpen::NXObject, public virtual NXOpen::IProfile, public virtual NXOpen::IFitTo { /** Boolean operation type. */ public: enum BooleanType { BooleanTypeCreate/** Create */, BooleanTypeUnite/** Unite */, BooleanTypeSubtract/** Subtract */, BooleanTypeIntersect/** Intersect */, BooleanTypeEmbossNormalSide/** Emboss, keep tool on normal side of sheet */ = 8, BooleanTypeEmbossOppositeNormalSide/** Emboss, keep tool opposite of normal side of sheet */ }; /** Diagnostic type */ public: enum DiagnosticType { DiagnosticTypeInformation/** Information alert */ = 1, DiagnosticTypeWarning/** Warning */ }; private: FeatureImpl * m_feature_impl; private: friend class _FeatureBuilder; protected: Feature(); public: ~Feature(); /** Returns the expressions created by the feature. The order in which expressions are returned is not significant and may change @return <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: std::vector<NXOpen::Expression *> GetExpressions ( ); /** Returns the immediate parent features. The order in which parents are returned is not significant and may change @return <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") */ public: std::vector<NXOpen::Features::Feature *> GetParents ( ); /** Returns the immediate child features. The order in which children are returned is not significant and may change @return <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: std::vector<NXOpen::Features::Feature *> GetChildren ( ); /** Returns all immediate child features. The order in which children are returned is not significant and may change @return <br> Created in NX9.0.1. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR insp_programming ("INSPECTION PROGRAMMING") */ public: std::vector<NXOpen::Features::Feature *> GetAllChildren ( ); /**Returns the algorithm version of the feature <br> @deprecated Deprecated in NX8.5.0. Algorithm version is for internal use only. There is no replacement for this method. <br> <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: NX_DEPRECATED("Deprecated in NX8.5.0. Algorithm version is for internal use only. There is no replacement for this method.") int AlgorithmVersion ( ); /**Returns the location of the feature <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR insp_programming ("INSPECTION PROGRAMMING") */ public: NXOpen::Point3d Location ( ); /**Returns the timestamp of the feature <br> Created in NX3.0.0. <br> <br> License requirements : None */ public: int Timestamp ( ); /**Returns the feature type <br> Created in NX3.0.0. <br> <br> License requirements : None */ public: NXString FeatureType ( ); /** Highlight the body created by the feature <br> Created in NX3.0.0. <br> <br> License requirements : None */ public: void Highlight ( ); /** Unhighlight the body created by the feature <br> Created in NX3.0.0. <br> <br> License requirements : None */ public: void Unhighlight ( ); /** Make current feature <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void MakeCurrentFeature ( ); /** Show the body created by the feature. The feature curves are to be moved to work layer if the curves are non-selectable when move_curves is true. <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void ShowBody ( bool moveCurves /** move curves */ ); /** Show the body created by the parent feature. The parent curves of feature are to be moved to work layer if the curves are non-selectable when move_curves is true. <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void ShowParents ( bool moveCurves /** move curves */ ); /** Hide the body created by the feature <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void HideBody ( ); /** Hide the body created by the parent feature <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void HideParents ( ); /** Suppress the feature <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void Suppress ( ); /** Unsuppress the feature <br> Created in NX3.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void Unsuppress ( ); /**Returns the suppression status of the feature <br> Created in NX3.0.0. <br> <br> License requirements : None */ public: bool Suppressed ( ); /** Returns the entities created by the feature. The order in which entities are returned is not significant and may change. @return <br> Created in NX4.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: std::vector<NXOpen::NXObject *> GetEntities ( ); /** Returns the feature error messages. error_messages can be NULL. The order in which error messags are returned is not significant and may change @return <br> Created in NX5.0.0. <br> <br> License requirements : None */ public: std::vector<NXString> GetFeatureErrorMessages ( ); /** Returns the feature informational messages. info_messages can be NULL. The order in which informational messags are returned is not significant and may change @return <br> Created in NX5.0.0. <br> <br> License requirements : None */ public: std::vector<NXString> GetFeatureInformationalMessages ( ); /** Delete all informational alerts from the features <br> Created in NX5.0.0. <br> <br> License requirements : None */ public: void DeleteInformationalAlerts ( ); /** Delete all warning alerts from the features <br> Created in NX10.0.0. <br> <br> License requirements : None */ public: void DeleteWarningAlerts ( ); /** Returns the feature warning messages. warning_messages can be NULL. The order in which warning messags are returned is not significant and may change @return <br> Created in NX5.0.0. <br> <br> License requirements : None */ public: std::vector<NXString> GetFeatureWarningMessages ( ); /** Returns the feature clue messages. clue_messages can be NULL. The order in which clue messags are returned is not significant and may change @return <br> Created in NX8.0.1. <br> <br> License requirements : None */ public: std::vector<NXString> GetFeatureClueMessages ( ); /** Delete all clue alerts from the features <br> Created in NX8.0.1. <br> <br> License requirements : None */ public: void DeleteClueAlerts ( ); /** Returns both clue and hint messages of the feature. num_clueHint can be NULL. The order in which clue and hint messags are returned is not significant and may change @return <br> Created in NX8.0.1. <br> <br> License requirements : None */ public: std::vector<NXString> GetFeatureClueHintMessages ( ); /** Returns the feature hint messages. hint_messages can be NULL. The order in which hint messags are returned is not significant and may change @return <br> Created in NX8.0.1. <br> <br> License requirements : None */ public: std::vector<NXString> GetFeatureHintMessages ( ); /** Delete all clue alerts from the features <br> Created in NX8.0.1. <br> <br> License requirements : None */ public: void DeleteHintAlerts ( ); /** Make the parent sketch internal if referenced only by this feature. <br> Created in NX5.0.1. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void MakeSketchInternal ( ); /** Make the parent sketch external for reuse by other features. <br> Created in NX5.0.1. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void MakeSketchExternal ( ); /** Remove all the feature faces before a NoHistory mode edit. <br> Created in NX6.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void RemoveForEdit ( bool dependent /** dependent */ ); /** Remove Local feature parameters in history free mode. <br> Created in NX7.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void RemoveParameters ( ); /**Returns true if the feature is internal. <br> Created in NX6.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: bool IsInternal ( ); /** Show all feature dimensions of a feature. <br> Created in NX6.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void ShowDimensions ( ); /** Returns the displayed name of the feature. @return displayed name <br> Created in NX6.0.0. <br> <br> License requirements : None */ public: NXString GetFeatureName ( ); /** Queries a feature for list of its sections. The order in which sections are returned is not significant and may change @return Array of sections <br> Created in NX7.5.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: std::vector<NXOpen::Section *> GetSections ( ); /** Set a feature group as active group. If input is NULL, set no feature group active <br> Created in NX7.5.1. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void SetGroupActive ( bool active /** active */ ); /** Log a diagnostic alert for this feature <br> Created in NX8.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void LogDiagnostic ( int errorCode /** errorcode */ , const NXString & message /** message */ , NXOpen::Features::Feature::DiagnosticType diagnosticType /** diagnostictype */ ); /** Log a diagnostic alert for this feature <br> Created in NX8.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ void LogDiagnostic ( int errorCode /** errorcode */ , const char * message /** message */ , NXOpen::Features::Feature::DiagnosticType diagnosticType /** diagnostictype */ ); /**Returns true if the feature is a contained feature. If it is a contained feature, use the property @link NXOpen::Features::Feature::ContainerFeature NXOpen::Features::Feature::ContainerFeature@endlink to get the container feature for this feature. <br> @deprecated Deprecated in NX9.0.0. Use @link NXOpen::Features::Feature::ContainerFeature NXOpen::Features::Feature::ContainerFeature@endlink and check if it is NULL instead. <br> <br> Created in NX8.5.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: NX_DEPRECATED("Deprecated in NX9.0.0. Use NXOpen::Features::Feature::ContainerFeature and check if it is NULL instead.") bool IsContainedFeature ( ); /**Returns the container feature for this feature. Will be set to NULL if this feature is not a contained feature. <br> Created in NX8.5.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: NXOpen::Features::IContainerFeature * ContainerFeature ( ); /** Change Boolean Type <br> Created in NX9.0.0. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: void ChangeBooleanType ( ); /** The feature color @return <br> Created in NX9.0.1. <br> <br> License requirements : None */ public: NXOpen::NXColor * GetFeatureColor ( ); /** Break Wave Link Feature @return <br> Created in NX11.0.1. <br> <br> License requirements : solid_modeling ("SOLIDS MODELING") OR cam_base ("CAM BASE") OR geometric_tol ("GDT") OR insp_programming ("INSPECTION PROGRAMMING") */ public: bool BreakWaveLink ( ); }; } } #ifdef _MSC_VER #pragma warning(pop) #endif #ifdef __GNUC__ #ifndef NX_NO_GCC_DEPRECATION_WARNINGS #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif #endif #undef EXPORTLIBRARY #endif
最新发布
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值