Zepmanbc / creopyson

Python library for Creoson (http://www.creoson.com)
MIT License
57 stars 5 forks source link

Not an issue - Just a question #29

Closed stekicar closed 3 years ago

stekicar commented 3 years ago

Description

Does creopyson/creoson have module that collects coordinates of clicked mouse position in drawing? If not, how hard could it be to make one?

Zepmanbc commented 3 years ago

Hello, I don't think it is possible through Creoson the only feature with user interaction I know is feature.user_select_csys

To get mouse position you can use PyAutoGui but I don't kwnow if it will fit with your needs

stekicar commented 3 years ago

Ok. I need something like this to place symbol in drawing manually. I will see if PyAutoGui will do the trick.

Zepmanbc commented 3 years ago

If you want to pause your script to put some symbols manualy, you can easily put a message box with PyautoGui too, and then resume the script when it's done.

stekicar commented 3 years ago

"creopyson.drawing.create_symbol" needs symbol location parameter and I will have to see how pixel location translate to creo drawing location. Especially when zoomed in.

Zepmanbc commented 3 years ago

you can run a mapkey to resize screen

adama2000 commented 3 years ago

I don't think JLink in general provides the ability to address mouse positions or screen coordinates. So it's unlikely creoson could support it.

stekicar commented 3 years ago

Can JLink return selected features or surfaces? Or anything else that is selected? I know for dimensions and CSYS.

adama2000 commented 3 years ago

Funny you should ask, I just an hour ago checked in a new feature.list_selected function to return what features are selected. It will be in the next release.

Creoson issue: https://github.com/SimplifiedLogic/creoson/issues/32

On Sun, Feb 21, 2021 at 8:26 PM stekicar notifications@github.com wrote:

Can JLink return selected features or surfaces? Or anything else that is selected? I know for dimensions and CSYS.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/29#issuecomment-782979079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANPKPD54NS2VKXOCGQODLDTAGXE5ANCNFSM4X6O3OFQ .

davidhbigelow commented 3 years ago

BUT WHY?

What will be the purpose of this after the selection?

On Sun, Feb 21, 2021 at 20:30 adama2000 notifications@github.com wrote:

Funny you should ask, I just an hour ago checked in a new feature.list_selected function to return what features are selected. It will be in the next release.

Creoson issue: https://github.com/SimplifiedLogic/creoson/issues/32

On Sun, Feb 21, 2021 at 8:26 PM stekicar notifications@github.com wrote:

Can JLink return selected features or surfaces? Or anything else that is selected? I know for dimensions and CSYS.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/Zepmanbc/creopyson/issues/29#issuecomment-782979079 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AANPKPD54NS2VKXOCGQODLDTAGXE5ANCNFSM4X6O3OFQ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/29#issuecomment-782980088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJMKYOVPOURRW5M6WQTTAGXUTANCNFSM4X6O3OFQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

stekicar commented 3 years ago

While I was working in Inventor I was heavily using VBA to speed up processes and minimize clicks. I was able to build a code that let you select round surface of the hole (or axis) and flat surface, then code would calculate which McMaster fastener to place, it would auto constrain and pattern fastener if hole was patterned. I was using measurement tool in code to get all data I need to pick and place fasteners. So, I would like to do the same thing with Creo.

davidhbigelow commented 3 years ago

Seems ambitious for Creo...

On Sun, Feb 21, 2021 at 20:49 stekicar notifications@github.com wrote:

While I was working in Inventor I was heavily using VBA to speed up processes and minimize clicks. I was able to build a code that let you select round surface of the hole (or axis) and flat surface, then code would calculate which McMaster fastener to place, it would auto constrain and pattern fastener if hole was patterned. I was using measurement tool in code to get all data I need to pick and place fasteners. So, I would like to do the same thing with Creo.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/29#issuecomment-782984358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJJ2YDS6BWYNWVQBO63TAGZ3HANCNFSM4X6O3OFQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

stekicar commented 3 years ago

I did not try VBA with Creo yet, just because it looks pretty cumbersome - no VBA IDE built in Creo. And who knows what Creo API currently supports in code. That is why creoson/creopyson looked to me as much better solution.

davidhbigelow commented 3 years ago

CREO does have a VB interface — my understanding it is less capable thank JLINK .... not a VB guy, I try to avoid it. (Painful to debug)

The selecting of a feature is one thing ... you can do things like suppress or delete by Feature Id...

Surface ID is not as directly actionable ... but might be useful within a mapkey?!? (Maybe) and not directly related to a specific feature... (imported geometry would not enable a derived relationship to a protrusion, cut or fillet)

Creoson, while it does have some lower level capabilities is not really intended to augment user mouse picks... the goal is to not require much from user interactions.

This is why my question was raised... the concern that even if we could get some information.... what would you expect to do next... features are one thing, surfaces are another ... it can get pretty complicated after that - often bumping into JLINK (even Object TookKit) limitations pretty quickly depending on what your next steps and goals are...

The risk — we add something in that results in a hard “dead end” for what you can do after.

On Sun, Feb 21, 2021 at 21:05 stekicar notifications@github.com wrote:

I did not try VBA with Creo yet, just because it looks pretty cumbersome - no VBA IDE built in Creo. And who knows what Creo API currently supports in code. That is why creoson/creopyson looked to me as much better solution.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/29#issuecomment-782988597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJPGM3Z6AEKVCA5LXXLTAG3VXANCNFSM4X6O3OFQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

stekicar commented 3 years ago

Are you saying that Creo has VBA IDE built in like Excel or Inventor have? I do understand your concern about dead ends. Creo is full of surprises ... Look at how Creo manages hole tables, total disaster.

davidhbigelow commented 3 years ago

Yea... I am saying that Creo has a VB interface... given that you have VB experience... I would be curious as to your view/experience.

Hole tables ... particularly difficult. Mapkeys make them better.... we added special functionality in Nitro-CELL to support the writing of the Pro/TABLE format from Excel... but it still needs a mapkey to integrate.... pretty sure Object Toolkit is still painful for that (I am sure if anyone disagrees with that statement ... they will).

On Sun, Feb 21, 2021 at 21:25 stekicar notifications@github.com wrote:

Are you saying that Creo has VBA IDE built in like Excel or Inventor have? I do understand your concern about dead ends. Creo is full of surprises ... Look at how Creo manages hole tables, total disaster.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/29#issuecomment-782994659, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJI3HU4ANIXQZK46LOLTAG6AXANCNFSM4X6O3OFQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454