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: 

Looking help to improve my MachiningCloud interface Macro

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
5axes
1064 Views, 10 Replies

Looking help to improve my MachiningCloud interface Macro

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.

 

10 REPLIES 10
Message 2 of 11
rafael.sansao
in reply to: 5axes

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

Message 3 of 11
5axes
in reply to: rafael.sansao

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

Message 4 of 11
rafael.sansao
in reply to: 5axes

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

Message 5 of 11
5axes
in reply to: rafael.sansao

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

Message 6 of 11
5axes
in reply to: rafael.sansao

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

Fin.jpg

Message 7 of 11
5axes
in reply to: 5axes

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

Message 8 of 11
kukelyk
in reply to: 5axes

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..
Message 9 of 11
5axes
in reply to: kukelyk

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

 

 

Message 10 of 11
n_brandao
in reply to: 5axes

n_brandao_0-1708882373126.png

doesnt work, any sugestions?

 

Message 11 of 11
ondrej.mikulec
in reply to: n_brandao

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

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

Post to forums  

Autodesk Design & Make Report