Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get position of hole when have multiple workplane?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Timothy2021
631 Views, 3 Replies

How to get position of hole when have multiple workplane?

Hello, I have an issue with macro, I try to get the position of hole through WPPoint, but if there are multiple workplane, the position is incorrect.

 

Version: 2021.1.1.2021109

 

Test Macro:

 

ENTITY fs=entity('featureset','')

FOREACH item IN components($fs) {

print par $item.WPPoint

}

 

Steps to reproduce:

  1. Import model(this model just have one hole)
  2. Create and active workplane “A”
  3. Copy workplane “A” to “B”, move “B” to somewhere
  4. Active workplane “B”
  5. Create and active featureset 
  6. Create holes from model, use active workplane only
  7. Run macro, WPPoint and values of position in the Edit Hole dialog are different. WPPoint relative to workplane A, position in the Edit Hole dialog relative to workplane B.

 

01.png

 

Please help me to get the correct hole position, thanks!

 

Labels (1)
3 REPLIES 3
Message 2 of 4
cfastNJWK6
in reply to: Timothy2021

I'm sure that there is a better way to do this, but this is the first that popped into my head.  You can calculate a block around each individual hole and then look at the block size:

 

ENTITY fs=entity('featureset','')

EDIT BLOCK COORDINATE WORKPLANE
EDIT BLOCK LIMITTYPE FEATURESET
EDIT BLOCKTYPE BOX
FOREACH $item IN components($fs) {

EDIT FEATURESET $fs SELECT $item
EDIT BLOCK RESET

EDIT BLOCK XLEN "0"
EDIT BLOCK YLEN "0"

print par $Block.Limits.Xmax
print par $Block.Limits.Ymax
print par $Block.Limits.Zmax


EDIT FEATURESET $fs DESELECT ALL
}

 

 

Message 3 of 4
Timothy2021
in reply to: cfastNJWK6

Thank you for replying, I'll give it a try.
Message 4 of 4
Timothy2021
in reply to: cfastNJWK6

Perfect, Thank you so much.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report