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

Xref support #193

Open
turtle0x1 opened this issue Nov 29, 2018 · 11 comments
Open

Xref support #193

turtle0x1 opened this issue Nov 29, 2018 · 11 comments

Comments

@turtle0x1
Copy link

I originally raised this in the other repository here and I think its really important feature, I would love to roll this out as but our workflow is xref centric, will it land in version 3 ? Libredwg currently has an open issue to extract xref paths from dwg files (I am trying to implement the tool but im not sure I have the required skill set).

I assume xrefs aren't part of the dxf standard so im aware that this probably causes some compatability issues

@feragon
Copy link
Member

feragon commented Nov 30, 2018

xref will probably be supported in LibreCAD 3, but it's not in our priority list. Can you work on this?

LibreDWG is not used by LibreCAD because of a license incompatibility, at least with v2.

@turtle0x1
Copy link
Author

turtle0x1 commented Nov 30, 2018

Is xref in the dxf spec ? because if not I presume we will have file format incompatibilities ? I can give it ago but I am in no means a cpp developer, can you give me a couple of pointers where to start ?

EDIT

So it appears that xrefs are in the dxf spec, ill get some dxf's with xrefs and try have ago if you can point me in the direction

@turtle0x1
Copy link
Author

@feragon Im having trouble connecting a button click on the action bar to a dialogue ui driving me pretty crazy any examples in the existing code i can see luaInterface:connect(layers, "layerChanged(lc::meta::Layer_CSPtr)", colorSelect, "onLayerChanged(lc::meta::Layer_CSPtr)") but im not sure

@feragon
Copy link
Member

feragon commented Nov 30, 2018

I saw some occurences of xref in DXF specifications. We'll of course have format incompatibilities between DXF and DWG so don't worry for this.

I suggest you to try to read xrefs from DXF files, to get a better idea of the representation. You can find our library in the LibreCAD/libdxfrw repo.
Here is the entry point for loading a DXF file : https://github.com/LibreCAD/libdxfrw/blob/8076034027a9c7b1e7d5a7ccac095179363ef9d2/src/libdxfrw.cpp#L64

The code you see is to connect a GUI element signal to a GUI element slot. Can you give me an example of the code you're trying to run ?

@turtle0x1
Copy link
Author

So i just started farmilizing myself with the way the gui is put together to picke up some lua and cpp. Here you can see my lua activity for clicking on the new button I put the toolbar, im trying to connect it to a dailog.ui file but im not sure how to do that?

@rupakbajgain
Copy link
Contributor

Lua and c++ are connected in lcUI/lua/qtbridge.cpp, i think clicommand does same what you are asking for, which can be taken as example.

@rupakbajgain
Copy link
Contributor

For kernel it is, lcadluascript/lckernelbridge.cpp .

@turtle0x1
Copy link
Author

Thanks for that!

@feragon
Copy link
Member

feragon commented Dec 1, 2018

@turtle0x1 Nice work !
In xrefoperation.lua, I think this line : local x = lc:XrefManager(); should be local x = lc.XrefManager();

But you don't need to create an operation class to open a window.
In this line : https://github.com/turtle0x1/LibreCAD_3/blob/8793c439c8a5bf7c6d5676518f1daa0e315aeddb/lcUILua/ui/toolbar.lua#L184 , you can replace create_basic_operation(…) with the code to open your dialog.

@turtle0x1
Copy link
Author

Thanks, first time using lua quite a nice language though, so i can just replace create_basic_operation with lc:XrefManager? I think I tried with the dot and it didnt work but ill take another look

@feragon
Copy link
Member

feragon commented Dec 1, 2018

Yes, so you don't need the xrefoperation.lua file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants