fix: P134 set_material verifies (zh/en names), run_macro binds swApp/Part and reports where it stopped - #5
Merged
Conversation
…Part and reports where it stopped set_material: SetMaterialPropertyName2 returns nothing and silently ignores an unknown name (a Chinese install has 合金钢, not "Alloy Steel"), so the tool reported success while the tree said 材质 <未指定> and masses came out at water density. Each candidate (given name, then its zh/en alias, both database spellings) is now applied and verified by reading the density back; nothing taking is an error. run_macro: the description promised swApp and Part were bound, but nothing assigned them, and a runtime error inside the entry Sub reached the runner with Err clear, so broken macros "completed". The entry Sub now binds swApp/Part/swModel when used, records line number + text before each statement (skipping continuation lines and the first line after Select Case) and sets a completion flag at its end and on every Exit Sub; a macro that did not reach the end fails with the line it stopped on. Connection note: first result only, and distinguishes not-running / background instance shown / second instance started. 201 JS + 67 Python tests pass; typecheck, lint, ruff, compileall OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
v0.2.133 (P134). This fixes three problems seen in a real session: the part was built correctly, but its material was never applied, and the agent then spent about ten calls on macros that silently did nothing.
set_materialSetMaterialPropertyName2returns nothing and silently ignores unknown names; a Chinese install has 「合金钢」, not "Alloy Steel".verified:falseinstead of claiming success.run_macro: nothing was boundswAppandPartwere bound, but nothing assigned them.Subnow bindsswApp/Part/swModelwhen the macro uses them.run_macro: runtime errors reported as successSubstill came back as "脚本执行完成".Subis now instrumented:Select Case.Suband on everyExit Sub.Related Issue
N/A
Type of Change
Testing
npm testpasses (201 tests). Newvba-macro-writertests cover binding, the completion flag, line reporting, and no marker where VBScript forbids a statement.npm run lintpasses.typecheck,ruff,pytest(67 tests) andcompileallalso pass. Newset_materialtests cover the zh fallback, an error when nothing takes, and the ambiguous case.run_macrothat readsPart.GetTitleChecklist