Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCH_PrimitiveComponent.create() 方法存在问题 #6

Open
klxf opened this issue Oct 28, 2024 · 1 comment
Open

SCH_PrimitiveComponent.create() 方法存在问题 #6

klxf opened this issue Oct 28, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@klxf
Copy link

klxf commented Oct 28, 2024

参数问题

按照文档传入了必要参数,但是却出现报错

componentUUID = "9f9c6cb41c7449fd8acf96aceed2661a";
subLibraryId = "0819f05c4eef4c71ace90d822a990e87";
x = 200;
y = 500;

eda.sch_PrimitiveComponent.create(componentUUID, subLibraryId, x, y).then((result) => {
	console.log(result);
});
Uncaught (in promise) Error: 数据不符合规范
    at de.setState_AddIntoBom (api.js:4:144858)
    at de.create (api.js:4:142431)
    at Ai.create (api.js:4:137690)
    at a0560074-4ff6-4097-8360-9b6d208010ba:370:33

坐标问题

传入所有参数能放置元件,但是放置的坐标存在问题,下面的代码将在 200, 500 放置元件,但是实际却放置在了 200, -200(最神奇的是使用 getState_X, getState_Y 获取到的坐标还是正确的 200, 500

componentUUID = "9f9c6cb41c7449fd8acf96aceed2661a";
subLibraryId = "0819f05c4eef4c71ace90d822a990e87";
x = 200;
y = 500;
rotation = 0;
mirror = false;
libraryPath = "0819f05c4eef4c71ace90d822a990e87";
addIntoBom = true;
addIntoPcb = true;
eda.sch_PrimitiveComponent.create(componentUUID, subLibraryId, x, y, rotation, mirror, libraryPath, addIntoBom, addIntoPcb).then((result) => {
	console.log(result.getState_X() + ", " + result.getState_Y());
});
@yanranxiaoxi
Copy link
Collaborator

该问题已建单,等待修复中~

@yanranxiaoxi yanranxiaoxi self-assigned this Oct 29, 2024
@yanranxiaoxi yanranxiaoxi added the bug Something isn't working label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants