HOW TO APPEND STOCK MODEL

HOW TO APPEND STOCK MODEL

DORMER
Contributor Contributor
2,896 Views
15 Replies
Message 1 of 16

HOW TO APPEND STOCK MODEL

DORMER
Contributor
Contributor

HOW TO APPEND MULTI STOCK MODEL

2,897 Views
15 Replies
Replies (15)
Message 2 of 16

kamalrajcv
Alumni
Alumni

Hi @DORMER

 

Welcome to the Autodesk community.

This is not technically possible, because the stockmodel data structures will almost certainly not be compatible. 

 



Kamalraj C V

Technical Support Specialist

0 Likes
Message 3 of 16

TK.421
Advisor
Advisor

The only way (that I know of) is to export each stock model as an stl or dmt file. then import all of those into your CAD software, and export them all in one file. then you're able to load them as your stock block and create a stock model from that.

this can be a lengthy process as the triangle models tend to be very large.

 


the numbers never lie
Message 4 of 16

iamcdn79
Mentor
Mentor

Take a look at this instruction video made by @anbu_kumar on how to make multiple stock models and join them as one


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

Message 5 of 16

Pradipio
Autodesk Support
Autodesk Support

Hey @iamcdn79,

Thanks for write to us, But there is the only way right now, Export Stock model from powermill multiple time as required and Import to Powershape in the single window then export it again for Powermill block( Triangles ). 

Cheers,

#PM


-------------------------------------------------
THANKS
Pradip Mistry

”Community
0 Likes
Message 6 of 16

Pradipio
Autodesk Support
Autodesk Support

Hi @janakindustries,

Thanks for writing to us, you can also use attached macro & Screencast.

Cheers,

#PM

 

 

 


-------------------------------------------------
THANKS
Pradip Mistry

”Community
0 Likes
Message 7 of 16

Anonymous
Not applicable

got this error

 

Screenshot_1.png

0 Likes
Message 8 of 16

Chetan.Bankar
Alumni
Alumni

@Anonymous,

 

Thanks for the feedback.

 

I have tried this in PowerMill 2019 and the supplied macro by @Pradipio works at my end. Can you please try upgrading to PowerMill 2019 and see if this gets resolved??

 

If yes, then please consider marking it as an Accepted Solution by clicking on the "Accept as Solution" in the post. Taking a moment to do this will help others community having similar query find this useful answers.

 

Thanks for your time.

 

Regards,

 


Chetan Bankar
Global Product Support
Submitting & Viewing Support Requests | Web Support | Phone Support
Message 9 of 16

Anonymous
Not applicable

sorry i don t have 2019

0 Likes
Message 10 of 16

Anonymous
Not applicable

@Anonymous Don't worry about that macro working or not....it doesn't do what you asked for.

 

The only real way to do this as mentioned by @iamcdn79 is to export each stock model as an .stl, import all of those into your cad software....Powershape or Powermill Modeller, or any other cad software capable of importing .stl files. Then export that file containing all of your blocks as a new .stl

Then import that .stl as a stock model.

 

The video as was shared by @iamcdn79.........seems to outline the correct steps to perform as mentioned above.

 

https://knowledge.autodesk.com/community/screencast/99ca21d3-4f88-4eee-9f66-883c2a758d05

 

However, if my memory serves me correctly....exporting/importing .stl stock models only became available in Pmill 2018. Prior to 2018, I think the only option for import/export of stock model was for .stkmd format.

 

If that is the case....create the stock "blocks" in your cad software, then import the .stl using the block form.

Create your stock model, then apply block.

 

@Chetan.Bankar Please, if you don't have anything to offer other than "please upgrade to Powermill 2019" don't bother posting. Many of us are NOT going to upgrade just to solve a single issue, and are also tired of hearing from support:  "well it works in my version of Powermill"

 

Message 11 of 16

Chetan.Bankar
Alumni
Alumni
Accepted solution

@Anonymous wrote:

sorry i don t have 2019


Hi @Anonymous,

 

Sorry to hear that you don't have PowerMill 2019. Please find attached the macro 'multiblock_2018.mac' which will work in PowerMill 2018.

 

As you are aware; there is no easy way to append multiple stockmodels. This macro will help you in creating and exporting multiple stockmodels in a project as *.STL files as shown in video here. This individual files can then be import into PowerShape or CAD Software which can then be exported as a single STL file.

 

This single stl file can then be used as a Block defined by Triangles which can further be applied to a newly created stockmodel to give you appended stockmodel.

 

I hope this helps.

 

Thanks and Regards, 


Chetan Bankar
Global Product Support
Submitting & Viewing Support Requests | Web Support | Phone Support
0 Likes
Message 12 of 16

Genericxg
Advocate
Advocate
Accepted solution

hi @Chetan.Bankar

Create multiple blanks and inputs.
I modified a single output and transferred it to the blank. But it was not created.
How to combine two macros into one.
Attached file.

0 Likes
Message 13 of 16

Genericxg
Advocate
Advocate
Accepted solution

hi @Chetan.Bankar
Attached :

 


FUNCTION Main(){

STRING $BlockName = 'Block'
STRING $TempPath = 'C:\Temp\'

INT $Counter = 1
STRING LIST $SavedBlocks = {}
ENTITY LIST $Temp = {}

ENTITY LIST $BlockStockModels = INPUT ENTITY MULTIPLE StockModel "Please choose£¡£¡£¡"


IF is_empty($BlockStockModels) {

RETURN
}

FOREACH $StockModel IN $BlockStockModels {

ACTIVATE StockModel $StockModel.Name
//EDIT BLOCKTYPE TRIANGLES
//EDIT BLOCK RESET
STRING $Path = $TempPath + $BlockName + $Counter + ".stl"
EXPORT STOCKMODEL_SHADING ; $Path YES
INT $Size = add_last($SavedBlocks, $Path)
$Counter = Counter + 1
}
DEACTIVATE StockModel

$Temp = folder('Model')
STRING LIST $OldModels = {}
CALL Entity2String($Temp, $OldModels)

FOREACH $Block IN $SavedBlocks {
IMPORT MODEL $Block
DELETE FILE $Block
}

EDIT LEVEL "Triangle Model" SELECT ALL
STRING $Path = $TempPath + "BlockAll.stl"
EXPORT MODEL ALL "C:\Temp\BlockAll.stl" YES

$Temp = folder('Model')
STRING LIST $NewModels = {}
CALL Entity2String($Temp, $NewModels)


STRING LIST $ModelsToDelete = subtract($NewModels, $OldModels)
FOREACH $item IN $ModelsToDelete {
DELETE MODEL $item
}
DELETE LEVEL "Triangle Model"


EDIT BLOCK COORDINATE WORLD
EDIT BLOCKTYPE TRIANGLES
GET BLOCK $Path
BLOCK ACCEPT
DRAW BLOCK
DELETE FILE $Path

}

FUNCTION Entity2String(ENTITY LIST $EntityList, OUTPUT STRING LIST $StringList) {

$StringList = {}
FOREACH $item IN $EntityList {
INT $Size = add_last($StringList, $item.name)
}
}

 

0 Likes
Message 14 of 16

Genericxg
Advocate
Advocate
Accepted solution

hi @

 

 

 

FUNCTION Main(){

STRING $BlockName = 'Block'
STRING $TempPath = 'C:\Temp\'

INT $Counter = 1
STRING LIST $SavedBlocks = {}
ENTITY LIST $Temp = {}

BOOL EXEC = False
WHILE NOT $EXEC {
FORM BLOCK
DELETE BLOCK
EDIT BLOCK ALL UNLOCK
STRING Msg = "Select surfaces for block,"+crlf+"Click Calculate block and"+crlf+"RESUME when ready to continue"
MACRO PAUSE $Msg
BLOCK ACCEPT
CREATE STOCKMODEL ; FORM STOCKMODEL ;
EDIT STOCKMODEL ; STEPOVER ".5"
FORM ACCEPT STOCKMODEL
EDIT STOCKMODEL ; BLOCK ;
EXPLORER SELECT StockModel "StockModel\#" NEW
EDIT STOCKMODEL ; CALCULATE

STRING yesnoprompt = "done?" + crlf + " yes(ok) no(Continue)"
$EXEC = query $yesnoprompt
}

 

ENTITY LIST $BlockStockModels = INPUT ENTITY MULTIPLE StockModel "Selection of Residual Model Blanks for Output:"


IF is_empty($BlockStockModels) {

RETURN
}

FOREACH $StockModel IN $BlockStockModels {

ACTIVATE StockModel $StockModel.Name
//EDIT BLOCKTYPE TRIANGLES
//EDIT BLOCK RESET
STRING $Path = $TempPath + $BlockName + $Counter + ".stl"
EXPORT STOCKMODEL_SHADING ; $Path YES
INT $Size = add_last($SavedBlocks, $Path)
$Counter = Counter + 1
}
DEACTIVATE StockModel

$Temp = folder('Model')
STRING LIST $OldModels = {}
CALL Entity2String($Temp, $OldModels)

FOREACH $Block IN $SavedBlocks {
IMPORT MODEL $Block
DELETE FILE $Block
}

EDIT LEVEL "Triangle Model" SELECT ALL
STRING $Path = $TempPath + "BlockAll.stl"
EXPORT MODEL ALL "C:\Temp\BlockAll.stl" YES

$Temp = folder('Model')
STRING LIST $NewModels = {}
CALL Entity2String($Temp, $NewModels)


STRING LIST $ModelsToDelete = subtract($NewModels, $OldModels)
FOREACH $item IN $ModelsToDelete {
DELETE MODEL $item
}
DELETE LEVEL "Triangle Model"


EDIT BLOCK COORDINATE WORLD
EDIT BLOCKTYPE TRIANGLES
GET BLOCK $Path
BLOCK ACCEPT
DRAW BLOCK
DELETE FILE $Path

}

FUNCTION Entity2String(ENTITY LIST $EntityList, OUTPUT STRING LIST $StringList) {

$StringList = {}
FOREACH $item IN $EntityList {
INT $Size = add_last($StringList, $item.name)
}
}

 

0 Likes
Message 15 of 16

Genericxg
Advocate
Advocate

It is not ideal to get the blanks cyclically. What are the good suggestions?

0 Likes
Message 16 of 16

DORMER
Contributor
Contributor
Accepted solution

THANKS SIR,

                       THIS HAS REDUCED ME A LOT OF WORK DUE TO MACRO

                   THANKS AGAIN

0 Likes