Looking help to improve my MachiningCloud interface Macro

5axes
Advisor
Advisor

Looking help to improve my MachiningCloud interface Macro

5axes
Advisor
Advisor

Hello,

As mentionned in the title, I'm looking help or idea ( @kukelyk , @rafael.sansao ? )  to improve the macro I'm using to transform automaticaly  a STEP geometry into tool and holder in PMILL.

 

The joined file OK.mp4  demonstrate the use of these macro associated with MachiningCloud.
It works fine , but when the profil of the tool or the holder includes a hole the macro failed.  ( Video Ko.mp4)

 

Any Idea will be welcome.

 

Reply
Accepted solutions (2)
1,267 Views
10 Replies
Replies (10)

rafael.sansao
Advisor
Advisor

You need to delete the small segments of the pattern -> points.

Add this code after 'CURVEEDITOR FINISH ACCEPT':

EDIT PATTERN $NPattern SPLIT
EDIT PATTERN $NPattern DESELECT ALL
IF $Powermill.Units == 'metric' {
	EDIT PATTERN $NPattern SELECT LENGTH LT '.01'
} ELSE {
	EDIT PATTERN $NPattern SELECT LENGTH LT '.0004'
}
DELETE PATTERN $NPattern SELECTED
EDIT PATTERN $NPattern SELECT ALL
EDIT PATTERN $NPattern MERGE
EDIT PATTERN $NPattern DESELECT ALL

Let me know if it worked.

Rafael Sansão

EESignature

5axes
Advisor
Advisor

Thanks a lot @rafael.sansao  for this suggestion. But small segment are not the origin of this problem.

 It's really when we have a closed profile that the shank creation failed :

Profil.jpg

 

I have tested something like :

		EDIT PATTERN $NPattern CURVEEDITOR START
		CURVEEDITOR SELECT CLOSED
		CURVEEDITOR MODE SEGMENT_BREAK
		CURVEEDITOR BREAK_SEG "3"
		CURVEEDITOR MODE DEFAULT
		CURVEEDITOR DELETE SELECTED
		CURVEEDITOR FINISH ACCEPT
		YES

To remove one third of the profile .. But unfortunatly sometimes  the macro doesn't remove the right segment.  So I'm looking for a smart solution to obtain from a closed profile an open one, like in the following example:

Modif.jpg

0 Likes

rafael.sansao
Advisor
Advisor
Accepted solution

Closed profile is not the problem. Check this in the attached project.

I have set the tolerance manually to achieve the expected result (it will not work well in a macro Smiley Frustrated).

 

Can you close the holes using Capping Surfaces before using SPUN_PROFILE (by macro)? The result will be what you want.

 

 

 

Rafael Sansão

EESignature

5axes
Advisor
Advisor

Using Capping Surfaces looks like a good solution.. Not so easy to implement but I will try on that way.

0 Likes

5axes
Advisor
Advisor
Accepted solution

Ok final solution With creation of Upper and Lower Plane ...

Fin.jpg

5axes
Advisor
Advisor

Not so easy finally .. But step by step this macro is working better, on the good way.
Thanks for the Idea @rafael.sansao 

kukelyk
Advisor
Advisor
Nice job! There is another tortuous way: -create the section pattern as You already did -create boundary from this pattern -recognize holes, grab the largest diameter -calculate bounding box, limit its matching size to the previous diameter/2, and block boundary -unite the boundaries -new pattern from this boundary There can be problem with the hole recognition, if pmill make holes from the outer diameters..
0 Likes

5axes
Advisor
Advisor

Thanks a lot @kukelyk for your answer ... Not sure to fully understand your solution Smiley Very Happy

I have improved my solution and I think I'm closed to the final goal. I'm using 2 new macros to manage holder assemblies : (Final.mp4)

 

I'm still looking for a solution to supress automaticaly the useless part of the cone on  a complex Holder ( Last operations in the joined video) . An imagined solution was to detect the elements with the largest diameter and supress the upward element , but unfortunately in some cases this solution does not work (holding part bigger than conical part of the holder)Holder.jpg

 

 

n_brandao
Participant
Participant

n_brandao_0-1708882373126.png

doesnt work, any sugestions?

 

0 Likes

ondrej.mikulec
Advocate
Advocate

The macro must be run with an argument that is a model name.

So, you have 2 options:

  1. to run the macro from the command line with a model name as the argument
  2. to create an entity custom menu that runs that macro passing a selected model name as an argument
    PowerMill Help | Rules for adding menu options to PowerMill entity menu | Autodesk

0 Likes