How extract areas from different surfaces using ilogic

How extract areas from different surfaces using ilogic

moraesorlando
Advocate Advocate
2,235 Views
13 Replies
Message 1 of 14

How extract areas from different surfaces using ilogic

moraesorlando
Advocate
Advocate
Hello folks! My name is Orlando and I am new here and new using ilogic! It is my first post, after spending days reading a lot of posts over here, I continue with an issue unsolved. I would like to say thanks in advance and that I appreciate the help of all colleagues. Here is my doubt: I have a file with several surfaces created by the thicken/offset command. What I need is to extract the area of all these surfaces (separately) and put these values in a form built using ilogic (the form is done and working). I can do this manually using the Measure command, clicking in the surface, copying the value and pasting it in the form. But I want to avoid this manual work. Any colleague can help? Thanks
0 Likes
Accepted solutions (1)
2,236 Views
13 Replies
Replies (13)
Message 2 of 14

fullevent
Advisor
Advisor

Hello @moraesorlando and welcome,

 

is it an iam or ipt?

Can you zip us a pack&go and upload it.
A screencast of the previous manual process is also always helpful for such automation tasks.


Aleksandar Krstic
Produkt- und Projektmanager

Message 3 of 14

moraesorlando
Advocate
Advocate

Hello, thanks!

 

It is a ipt file.

I created a very simplified file and a Power Point with instructions about the manual tasks. Both are attached.

 

In this simplified file I used just one surface but in the real case I can have up to 10.

 

In tests I have done, I could see that the sintaxes shown below working correctly but doesn't reach my target because I don't want the total area of the body and my area does not come from a sketch.

(where Area is my variable)

 

Area = iProperties.Area

 

Area = Measure.Area("Sketch18")

 

But

 

Area = Measure.Area("OffsetSrf1")

 

doenst work.

 

If this sintaxe Area = Measure.Area("OffsetSrf1") works. The case would be solved

 

Best regards,

0 Likes
Message 4 of 14

moraesorlando
Advocate
Advocate

Hello @fullevent!

 

Did my information helps to understand my situation?

Is it possible to help me?

Thanks?

0 Likes
Message 5 of 14

fullevent
Advisor
Advisor

Hello @moraesorlando,

 

I just read your response. I'll see what's possible later today. I'm optimistic about finding a solution here.

 

regards


Aleksandar Krstic
Produkt- und Projektmanager

Message 6 of 14

fullevent
Advisor
Advisor

By the way.. do you want to use iLogic with a form (local) or a global form or can it be VBA macro with an userform?


Aleksandar Krstic
Produkt- und Projektmanager

Message 7 of 14

fullevent
Advisor
Advisor

I already have a first result. Maybe this is a good solution for you. What do you think?

 

the rule is integrated in the formthe rule is integrated in the formWith a click you can select a surface.With a click you can select a surface.the number equals the area in mm²the number equals the area in mm²is assigned to the user parameter Area_1is assigned to the user parameter Area_1

 

Attached the file. The value is now also rounded to 3 decimal places.

 

Regards,

Aleks


Aleksandar Krstic
Produkt- und Projektmanager

Message 8 of 14

moraesorlando
Advocate
Advocate

Hello @fullevent!

 

I just received your messages. Thanks for it.

Answering your question about the forms.

I initiated the idea using the  local form with the ilogic and look like this could be the solution. I haven't tried VBA with the userform.

 

About your solution,

Yes, this solution sounds very good for me.

 

I will download the file you sent and study deeply to understand well and try to apply in my real case.

 

Probably I will be back to you with some new doubts.

 

Thank you very much for your attention.

 

Best regards,

 

0 Likes
Message 9 of 14

fullevent
Advisor
Advisor

Glad I could help.
Please mark the post as "Solution" if that is the case after reviewing the ipt.


If there are new challenges, please create a new post with the new question. So everything stays clear and concise.

 

Until then, have a nice day 😊

 

 


Aleksandar Krstic
Produkt- und Projektmanager

Message 10 of 14

moraesorlando
Advocate
Advocate

Hello @fullevent!

 

I have studied the code and parameters you built, and look likes clear to me.

But when I tried to insert one more field to calculate area (as I told you in the real case I can have up to 10) the result is not the same.

 

Steps I used to build the new field for calculate the area:

I created a new parameter named Area_2

I created a new rule (rule 1), copying your code and inside the code I changed the Area _1 for Area_2 (in line 3 and line 5).

 

I put all in the form.

So, when I test, the result is pretty different.

 

First difference I have note:

When I click in my button rule 1, the form is disable and an instruction for select a face Is presented.

I select the face, but the instruction to select a face continue been presented to select a face again (not desired).

If I select the same face again, the instruction for select a face disappear and the form became enable again.

 

Second difference I noted:

If I put any value manually in the field Area_2 (details in the power point attached).

Automatically the rule Rule 1 is started (not desired).

 

When I use the field you built I don't see any of this issues.

 

Maybe I forgot to change something in the code or put some parameter in the wrong order?

 

Attached are the file and a presentation with details.

 

Thanks again

0 Likes
Message 11 of 14

fullevent
Advisor
Advisor
Accepted solution

Hello @moraesorlando,

 

oh yes i forgot to mention that you have to turn off the "automatic mode" of the rule
This will start the rule automatically when a parameter changes.

If you would always select different areas, this rule would start infinitely.

 

Open the rule1 and set the hooks as shown in the picture.

 

2020-04-21 07_23_54-Regel bearbeiten_ Rule1.png

 

Have fun 🙂


Aleksandar Krstic
Produkt- und Projektmanager

Message 12 of 14

fullevent
Advisor
Advisor

By the way, I find that you formulate your request very clearly. This in combination with the screenshots and the ipt file helps a lot to understand and to help you.

 

Keep it that way @moraesorlando  and you will always get support here very quickly. 👍


Aleksandar Krstic
Produkt- und Projektmanager

Message 13 of 14

moraesorlando
Advocate
Advocate

Hello @fullevent !!!

 

Yeah! With this last configuration in “Options” the code is working properly.

 

Thank you very much for your time and the attention about my case.

 

Its solved. I will mark the post with " Accepted Solution"

 

I hope count on your support in other futures posts.

Your support was fundamental for the solution of this case.

 

Glad to hear your comments about my description of the issue.

I will continue like this.

 

Best regards,

Message 14 of 14

ivopaulino
Community Visitor
Community Visitor

Thanks for the resolution it will be very helpful, as a part of a solution I'm developing

0 Likes