I need to create a custom explode view with API.
Is there any codes available to get below components?
simply I need to translate for a distance.
Please try this code when assembly is active document.
Dim swApp As SldWorks.SldWorks
Dim swmodel As SldWorks.ModelDoc2
Dim swassm As SldWorks.AssemblyDoc
Dim swConfigurationMgr As SldWorks.ConfigurationManager
Dim swConfiguration As SldWorks.Configuration
Dim swExplodeStep As SldWorks.ExplodeStep
Dim boolstatus As Boolean
Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc
Set swassm = swmodel
'Get explode step
Set swConfigurationMgr = swmodel.ConfigurationManager
boolstatus = swassm.CreateExplodedView
Set swConfiguration = swConfigurationMgr.ActiveConfiguration
'Select edge for direction Use Mark as 1
boolstatus = swmodel.Extension.SelectByRay(-4.22847390325956E-02, 2.03031470735482E-02, 0.114496934695069, -0.577381545199981, -0.577287712085548, -0.577381545199979, 1.22502941756646E-03, 1, True, 1, 0)
'Select component to translate Use Mark as 2
boolstatus = swmodel.Extension.SelectByID2("SheetMetal-1@TestAsse", "COMPONENT", 0, 0, 0, True, 2, Nothing, 0)
Set swExplodeStep = swConfiguration.AddExplodeStep(50 / 100, True, True, True)
boolstatus = swmodel.ForceRebuild3(False)
I found codes for this. But when i try to apply its getting errors.
here is those codes
"2017 SOLIDWORKS API Help - AddExplodeStep Method (IConfiguration) "
Dose anyone has sample?
Does anyone has example macro for explode a part?
Do you know how to add an Explode step to existing Explode view?
I don't want to create additional views.
Remove line:boolstatus = swassm.CreateExplodedView then try...
Thanks. Its working perfectly.
But when i create a specific step I'm getting another one unwanted step named as "Chain1". This is explode the whole assembly which I really don't want.
Could you please guide me, how to get Rid of this?
Couple of posts to check
Drawing Exploded Views
Drawing View Exploded size
Retrieving data ...