iLogic Rule to Measure Area of Two Faces

iLogic Rule to Measure Area of Two Faces

ethan_howardMMXXV
Collaborator Collaborator
108 Views
6 Replies
Message 1 of 7

iLogic Rule to Measure Area of Two Faces

ethan_howardMMXXV
Collaborator
Collaborator

Hello, First off, I'm not an iLogic master. I typically find a script, copy and paste it, and hope for the best. Just want you to know my level of knowledge.

The part I created is a surface of a cylinder and I used 2d & 3d sketches, and "split" to create the shapes on the surface of the cylinder. I then gave the two faces, Entity names and surface finishes as you can see from the screen capture.

What I want do is measure the area of two faces, add the sum, and track the change of the surface area as I modify sketches. The change will be modifying an angle that will change the shape and size of the faces being measured. I was thinking of using POSITION for each angle and MODEL STATES to track the change in area (maybe with granularity of 1°/5).  I'm sure there's a better way?

Here is something I grabbed from the community that looked promising for capturing the surface area of faces.

Dim iLogicAuto = iLogicVb.Automation

Dim namedEntities = iLogicAuto.GetNamedEntities(ThisDoc.Document)

Dim f As Face
f = namedEntities.FindEntity(COLD_OPENING), (HOT_OPENING)
Dim Eval As SurfaceEvaluator
Dim area As Double
Eval = f.Evaluator
area = Eval.Area
MsgBox("Face_Area : " & area)

 

ethan_howardMMXXV_0-1759260354144.png

I'm at the end of my day so I will check in tomorrow. Thank you for any help!

0 Likes
109 Views
6 Replies
Replies (6)
Message 2 of 7

Curtis_Waguespack
Consultant
Consultant

@ethan_howardMMXXV, here's a small example I had on hand, not sure if it's helpful for what you're doing, but maybe?

EESignature

Message 3 of 7

ethan_howardMMXXV
Collaborator
Collaborator

Hi Curtis, that is a powerful tool, and thank you for sharing. Very impressed! Above my knowledge at this time. I really need to take a course in iLogic. In the meantime...

 

I was thinking about what I actually want to track is each face's area (blue and red) and then the sum of both. So in the MODEL STATE, I envision four columns. 1) The sketch "Change the Angle" dimension, in increments of 1° to 5°, 2) Blue area, 3) Red area, 4) The sum of both Blue and Red areas.

 

The sketch,  "Change the Angle", is how the blue and red areas will change as the circles rotate around the cylinder. Once this is accomplished, I would then begin to change the fan shape as the design dictates.

 

I'd like to share my .ipt (attached) with the community in case there is someone able to help. If all fails, I will have to manually, probably using Excel, painstakingly enter each value. 

0 Likes
Message 4 of 7

ethan_howardMMXXV
Collaborator
Collaborator

Sorry, everyone. When changing the angle in the sketch, the part would fall apart. Here is a better part to work with. See attachment.

0 Likes
Message 5 of 7

marcin_otręba
Advisor
Advisor

so you want to have form in wchich you will change agle and it will show areas and sum of them? also button for creating new model state or what?

could you share correct model ? because in las one you have only one named face

marcin_otrba_0-1759503369723.png

 

i correcte your rule to show areas and sum of it:

Dim iLogicAuto = iLogicVb.Automation

Dim namedEntities = iLogicAuto.GetNamedEntities(ThisDoc.Document)

Dim COLD_OPENING_Face, HOT_OPENING_Face As Face
COLD_OPENING_Face = namedEntities.FindEntity("COLD_OPENING")
HOT_OPENING_Face = namedEntities.FindEntity("HOT_OPENING")
Dim COLD_OPENING_Area, HOT_OPENING_Area, SUM_Area As Double
COLD_OPENING_Area = COLD_OPENING_Face.Evaluator.Area
HOT_OPENING_Area = HOT_OPENING_Face.Evaluator.Area
SUM_Area = COLD_OPENING_Area + HOT_OPENING_Area
MessageBox.Show("COLD_OPENING_Area= " & COLD_OPENING_Area & vbCrLf &"HOT_OPENING_Area= " & HOT_OPENING_Area & vbCrLf & "SUM_Area= " & SUM_Area, "Area")

marcin_otrba_1-1759503462363.png

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 6 of 7

ethan_howardMMXXV
Collaborator
Collaborator

Hello, thank you for your interest in helping. Can you share the updated model?

0 Likes
Message 7 of 7

ethan_howardMMXXV
Collaborator
Collaborator

@marcin_otręba 

It worked! Thank you! See attachment.

Now the next step. Do you know if it's possible to add the "Named Entities" COLD_OPENING, HOT_OPENING, and the SUM of the two in MODEL STATES as shown in the screen shot? In my web search it did not appear it could be done. But maybe you know how?

ethan_howardMMXXV_1-1759756399827.png

Or maybe not using the NAMED ENTITIES but a different surface finish for each face? I changed the surface finish for each face, finish3 and finish4. Can iLogic use the surface finish to create the area for each face and the sum of the two?

ethan_howardMMXXV_2-1759756553966.png

I attached the ipt with working iLogic and faces with finishes.

 

 

0 Likes