Solidworks bounding box macro As the result 3D Sketch with bounding box is created. InsertGlobalBoundingBox to get the bounding box. You can also create a bounding box for any cut list item in a cut. Taking into consideration the bounding box's orientation, the bounding box is the smallest box in which the body fits. Get Assembly Bounding Box Using Assembly Example (C#) Open the Immediate window. I pulled a bounding box macro from some of the fine folks here. ' returned is larger and not a minimal bounding box. Open the Immediate window. To report problems encountered with the Web help interface and search, contact your local support representative. But now, I would like to be able to show the dimensions but not the actual box Sometimes, the additional lines makes it hard to read the The Cut-List Properties dialog box displays the 3D-Bounding Box Thickness, 3D-Bounding Box Width, 3D-Bounding Box Length, and 3D-Bounding Box Volume. Option Explicit. Nothing is loaded lightweight. This example shows how to get an accurate bounding box for a open part. My hope is to have a macro do the following: Create a bounding box. SldWorks Dim swModel As SldWorks. Now my question is: Is it possible that someone modify this macro to identify the shape and create the bounding box and size accordingly? For example, Regular shapes with length Here is my my macro, Solidworks tells me that it cannot calculate because of a type incompatibility for the calculation of XDim YDim and ZDim. My question: Is it possible to modify this to work with a user defined co-ordinate system if there is one exists in the part? Would like bounding box macro that can output: * Bounding box dimensions in fraction inches rounded to common denominator up to 1/16 (no feet). sldprt file. Bounding boxes are used constantly in engineering for a variety of reasons. So I've been automating our formats to: use macro in assembly to save just the flatten dxf without bend lines (open assembly, launch macro, macro saves dxfs into folder same as assembly) added a bounding box to our part template and tied it to our Drawing template so regardless of bend or flatten state the drawing reads its the sheet mental Array of 6 doubles representing the extents of the bounding box Example. swp. I was using quite an old macro from this forum to get the bounding box and stock size. thread559-225049. Run the macro. This software allows you to automatically find the dimensions of parts and assemblies in x,y,z axes when creating tables such as BOQ and BOM. Reference the x and y lengths of that bounding box and add a parenthesis on both of those dims (reference dim) I need to link some of my custom properties to cut-list properties. ' ' NOTES: ' * Because all assembly component bounding boxes are ' approximated, the bounding box for the assembly ' is also approximated. Thank You. This example also shows how to draw 3D sketches depicting the bounding boxes. This VBA macro creates a bounding box sketch based on SOLIDWORKS 3D bounding box. To provide feedback on individual help topics, use the This example shows how to get the bounding boxes for the selected feature and face. Preview | ©2002-2025 Dassault Systemes SolidWorks Corporation Get Part Bounding Box Example (VBA) This example shows how to get an accurate bounding box for a open part. View in SOLIDWORKS User Forum View on body Bounding box macro. From what I've gathered from online resources, here is my (maybe 100th) attempt at the macro. github. This worked perfect the first time I tried it. in Sherwood, AR. after my macro runs hello im a newbie . i found examples on web however i can not able to run this macro? Could anyone tell me what should i do for running macro. '-----' Preconditions: ' 1. For parts created by SW2018 it works fine, I just use "SW-Bounding Box Length@@@CutList@@Configuration Name@Filename. Updates the bounding box. I ran the program but I don't think it's the smallest possible box. I got downloaded this macro from the forum and it is very useful to get the overall size. All segments from the sketch can be selected and used for reference or geometry creation. * The dimensions are from smallest to greatest (ex: 1/2" x 10-1/2" x 13-3/16") ' 3. // // Postconditions: // 1. Can anyone convert or add fractional inches to the macro please? We are on SW2017 for another year. Macro requires user to select the input parameter to identify the direction of the cylinder. I am trying to export the dimensions to an Excel sheet of every solid body. Is there a way to modify Wayne's macro to determine the smallest possible bounding box? I would expect that to make the box line up with the part coordinate system rather than The home for the SOLIDWORKS Forum. Thanks for any help. Hi all, I wanted to know if there is any standard tool that creates a Construction/Bounding Box around a segment of a 3d sketch in order to control it accurately with x,y, and z dimensions. I would like to create a macro that will display the dimensions of the bounding box Have you tried checking on the library references? To do this, open the macro in the editor and select Tools -> References. ©2002-2025 Aha I found the answer!. Use past experience and experimental data to review the suggested bounding box, and modify it if required. Thanks. Source code: https://gist. Hi! I am trying to get a macro to draw a bounding box on each part and assembly within a folder, and add the length, width, and height to the properties. The following sample code shows how you might create a dimension for a macro feature. ' in calculations. You can create a bounding box for a multibody, single You can create a bounding box for a multibody, single body, or sheet metal part. You should now have a copy of the bounding box directly on top of the original. The default bounding box seems to be aligned with a global axis, however I need it to reference the face of the end of the pipe. With over 35 years of experience, the TriMech Group offers a comprehensive range of design, engineering, staffing and manufacturing solutions backed by experience and expertise that is unrivalled in the industry. Examine the graphics area and Immediate window to verify. SOLIDWORKS ® captures the bounding box parameters and records them in the Custom Properties dialog box. The home for the SOLIDWORKS Forum. so I was really excited that here was a nice easy way for me to generate a cutting list for all the parts in my assembly. ' Solidworks CAD software is a macro software that creates a bounding box for each part and all sub-assemblies of large assembly models. change Bounding Box Macros ©2002-2025 Dassault Systemes SolidWorks Corporation Does anyone have a macro that will create a bounding box around a part? Regards, Jon jgbena@yahoo. Preview | SOLIDWORKS USER FORUM change Bounding Box Macros. Verify that the part to open exits. Notes. Notes Macro will use existing 3D bonding box ' 3. I thought the below lines of code will help: customPropArray = swBOMTableAnnotation. Prints the lower- and upper-diagonal corner points ' of the bounding box to the Immediate window. To report problems encountered with the Web help interface and search, contact your local support Using the SOLIDWORKS Sheet Metal Bounding box you can automate the creation of flat pattern data in your related drawing. I found one good macro that works perfect with solids, however if the solid is not aligned with the axis, it gives a false Hi All, I've been programming a macro that would select the first feature in my Cut-list folder and then create a 3D Bounding Box for the selected item. With a large assembly, I get the same highlight, but after I click the Benefits of bounding boxes: For parts, bounding box dimensions are available as properties in the Configuration Properties tab of the Properties dialog box. Solidworks Macro for Generating 3D Bounding Box from Part/Assembly File - bounding_box. Dear all, I have a macro which copies the bounding-box length and width from the cut-list properties of the sheet-metal part to its configuration specific properties. ' ' NOTES: ' * Because all assembly component bounding boxes are ' approximated, the bounding box for the assembly ' is also approximated Hi, attached is a bounding box size macro. Hey guys, SW2018 has this cool feature of creating a bounding box. '-----' ' Problem: ' IPartDoc::GetPartBox returns an approximate ' bounding box and cannot be relied upon to be used ' in calculations. ' ' NOTES: ' * Because all assembly component bounding boxes are ' approximated, the bounding box for the assembly ' is also approximated The home for the SOLIDWORKS Forum. Adds a 3D sketch to the assembly showing the bounding box. ' 2. Is there any way to change so it sorts the three sizes from least to greatest? I'm using SW 2017 Thank You. However, I will need to spend some time making sure I understand the calls and functions so I have to put that on the back burner for now. In this blog post, I want to cover the pros and cons of the various techniques available in the SolidWorks API for determining them. - xarial/codestack Wrong bounding box false Is it possible with macro ? Is there another way? Catalog. com. The bounding box is represented by a 3D sketch and is based, by default, on the X-Y plane. Preview | SOLIDWORKS USER FORUM Macro for getting bounding boxes' dimensions in a multiple solid bodies part. SS By Solidworks Selim 07/27/16. Typically, the bounding box ' returned is larger and not a minimal bounding box. (Big Thanks to: Hugo Pires, who contributed the original macro) This creates the box in relation to the default co-ordinate system. It appears to be using the standard coordinate system to orient the part. I searched the forums for "bounding box" and found a macro called BoundingBox. In C++, create containers for the dimension types and values before inserting the macro feature: //Create dimension containers long dimType[MBossDimNum] = { swLinearDimension, swLinearDimension, A 2nd option is creating a new 3D sketch, then select the individual sketch lines which make up the bounding box. View in SOLIDWORKS User Forum View on ©2002 Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in. AssemblyDoc Library of SOLIDWORKS API, SOLIDWORKS PDM API, VBA and Desktop code examples, applications macros and tutorials. Macro features that use VBA macros to define the macro feature functions must reside in SOLIDWORKS VBA macro files (*. GetAllCustomProperties For Each You can create bounding boxes around models to help you determine the space required to ship and package products. SW2018 has this cool feature of creating a bounding box. This example also shows how to draw 3D sketches depicting the The following macros will calculate the bounding box, width, height and length of the active part document using both approaches of SOLIDWORKS API. But here is what I get: I am not a programmer, but I have used some VBA with excel before. Use the form below Hi, I have a bounding box macro (L x W x H) and it works great. BT By Benson Tsui 07/22/24. The following macros will calculate the bounding box, width, height and length of the active part document using both approaches of So it seems like it is not possible to use the SW 2013 new feature of Bounding Box from the weldments list, therefor I started looking at macros, same story there, almost everything was oriented for sheet metals. Online Help We always have to manually add the flat pattern view, add reference dimensions to the extremes in the x and y direction and then add a block annotation (pre-made). Chris C Catalog ©2002-2025 Dassault Systemes SolidWorks Corporation This Bounding Box macro has 1 module called "BoundingBoxCode" and that's what I am trying to run when I save a . How do I select a features end face/plane and then use as a reference for a bounding box with VBA? Default Bounding Box Get View Bounding Box and Position Example (VBA) This example shows how to get the bounding box, geometric center, and position lock status of all drawing views in the drawing sheet. I am wanting to use the Bounding Box values for automatically populating descriptions for my cut list. Improve this question. REAL People, REAL Experiences, REAL Knowledge. swp). Eric The home for the SOLIDWORKS Forum. ' ' NOTES: ' * Because all assembly component bounding boxes are ' approximated, the bounding box for the assembly ' is also approximated I am newbie about macro. com/AmenJlili/c040a98009908b34e66ade363bcf6b1fDXF macro: Furthermore, the bounding box may vary after rebuilding the model. Jan 7, 2005 3,411. Catalog. SLDPRT" variable and see actual value in "Calculated" column. VBA Environment: Pre-installed with SOLIDWORKS (Access via Tools > Macro > New or Edit) Operating System These parts are all freeform surfaces with no flat planes to speak of. ' 5. * Automatically creates 'SIZE' property either in custom property or configuration specific IF configuration is turned on. 1/PDMWorks 06 AutoCAD 06 ctopher's home (updated 06-21-06) Upvote 0 Downvote. Follow edited Sep 12, 2023 at 14:56. swp The following macros will calculate the bounding box, width, height and length of the active part document using both approaches of SOLIDWORKS API. ' ' Postconditions: ' 1. Open an assembly document. This example shows how to create a bounding box. For old-style sheet-metal parts (without Sheet-Metal folder), when modifying the part, it always Hey everyone, is it possible to delete a bounding box with a macro? I'm trying it since yesterday without success. Is it possible with macro ? ©2002-2025 Dassault Systemes SolidWorks Corporation I have a macro that creates a bounding box for a pipe selected in the weldment cut list folder. - GitHub - arslnakin/Bounding_Box_Automation_For_SW: Solidworks CAD software is a macro I need to determine the smallest possible box a certain part will fit in. I would write a macro to help them out since they would need to go through hundreds of files to unsuppress/unhide the cutlist/bounding box stuff they are trying to get to. W hen I hover over an assembly component (of a small assembly) in the feature tree, I get a bounding box-ish highlight and when I click on the component, the box disappears and the component is highlighted:. Typically, the bounding box. ' 6. Please help. Why do parts not have a bounding box, or overall dimensions; applied by default? At the moment I am having to create a bounding box to use within a cut-list. ©2002-2025 Dassault Systemes SolidWorks Corporation Bounding Box Length (mm) Bounding Box Width (mm) Surface Area (mm2) (iModel surface area, not the bounding box surf area) Mass (kg) In the macro attached you will see Bounding Box Length/Width, but I really dont know how to add the others. Gets the bounding box for the assembly. It traverses each component in the assembly, checking if a bounding box has already been created for the component. ' 1. I'm looking for advice on amending a macro I found here: 2017 SOLIDWORKS API Help - Get Assembly Bounding Box Using Components Example (VBA) The macro takes the max/min values from the Getbox method and returns corner point locations of all visible components. ©2002-2025 Dassault Systemes SolidWorks Corporation Benefits of bounding boxes: The overall dimensions of the bounding box appear in the Cut-List Properties dialog box so you can use them in a bill of materials, cut list, or other annotations. The way they have screwed up the bounding box in 2019 so that it will not update unless it is visible is a real pain in the backside. SS By Solidworks Selim 05/02/15. Each function: Must accept these three arguments, which must be declared as type VARIANT: ISldWorks interface of the calling process You can create cylindrical bounding boxes that are useful for bodies with cylindrical geometry such as rotational, circular, or turned parts. Hi, Not long ago I tweaked a macro to get the bounding box of an assembly using the 'GetBox' Method. Would there be someone that can do it for me? change Bounding Box Macros Catalog. '----- ' Preconditions: ' 1. If it is possible, where and exactly how would I edit this macro or create a new macro that will run this one everytime it's saved. Bounding Boxes for Sheet Metal. But I have many parts created by earlier versions of SolidWorks. Sub main() Dim swApp As SldWorks. Now my question is: Is it possible that someone modify this macro to identify the shape and create the Instantly share code, notes, and snippets. Wrong bounding box. // 2. I have Large Assembly Mode and Large Design Mode disabled. ' 4. Creates Bounding Box in the FeatureManager design tree. The X,Y,Z points returned by SOLIDWORKS are the lower and upper diagonal corners which bound the body with the box sides parallel to the X, Y and Z axes. This macro creates a bounding box for the main assembly and its components within the active document in SOLIDWORKS. SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. If not a bounding box type tool, can a macro be written to surround Solidworks CAD software is a macro software that creates a bounding box for each part and all sub-assemblies of large assembly models. ; With a bounding box, you can determine the length, VBA Macro Files and Macro Features. You use the macro that creates a 3D sketch of an existing bounding box! Otherwise it's difficult to create the 3D sketch, especially when SolidWorks macro creating a bounding box to get overall packaging/volume measurements. ' 7. Thanks in advance Patrick Catalog. Alternatively macro button Get Bounding Box Example (VBA) This example shows how to get the bounding boxes for the selected feature and face. Use the form below I need to collect accurate bounding box dimensions with the a macro so I can: open all the files, get the info, then export the part on new coordinate system based on the bounding box. '-----Option Explicit Sub The dimensions of a bounding box can help you determine the space required to ship and package product. // 3. Here is another quick SOLIDWORKS macro to add "Bounding Box" feature found under "Reference Geometry" to all the model files (parts and assemblies) in the selected folder. There is option to hide the bounding box as well. You can create a bounding box for a multibody, single Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in. Hey; I'm working on a macro to insert a bounding box that can distinguish if a rectangular or cylindrical box type is required but i can't seem to figure out how to call box type. Macro Features and Dimensions. Verify that the drawing document to open exists. I would like to create a macro that will display the dimensions of the bounding box as well as the mass of the part/assembly. false. Bounding Box Macro The home for the SOLIDWORKS Forum. Modifies a dimension in a component in the assembly. The sketch will be filled with "on edge" relations to the original lines, but it is editable. // // NOTES: // * Because all assembly component bounding boxes are // approximated, the bounding box for the assembly // is also approximated. Hi all, I have been using the bounding box macros to dimension the overall size of my assembly and it works really well. You can use these dimensions in a bill of materials or other annotations. Following u/Bildo79 's suggestion, I found a much easier way of going about it. Forum: Search: FAQs: Links: MVPs: Menu. The bounding box calculated by the SOLIDWORKS software might not have the minimum volume for some bodies and parts. ' 3. Oct 19, 2006 #3 handleman Automotive. The dimensions of a bounding box can help you determine the space required to ship and package product. ' ' NOTE: The bounding box is approximated and oriented ' with the assembly coordinate system. FeatureManager. Click Insert > Reference Geometry > Bounding Box. Creates a 3D sketch of the Open an assembly document. View in SOLIDWORKS User Forum View on Forum . You would think all that other stuff is the hard part, but the bounding box has been the real challenge. Any way to get to create the 'PERIMETER' property in configuration specific tab? Also, for some reason this macro creates two additional configurations 'as machined' and 'as welded'. Is there a way to have a macro turn on & then off a bounding box when the part is opened up automatically. Use your 3DEXPERIENCE ID to log in. without using a macro. ' Preconditions: Ensure that the specified model exists. This example demonstrates how to find the bounding cylinder of the solid body using SOLIDWORKS API. Modifies Toolbar+ is a part a free and open-source CAD+ Toolsetadd-in for SOLIDWORKS which allows organize the macro library in custom toolbars integrated to SOLIDWORKS environment. Preview | SOLIDWORKS USER FORUM Macro - insert bounding box: toggle 'type' EJ By Eric Jacobson 12/02/24. ' This VBA macro creates a bounding box sketch based on SOLIDWORKS 3D bounding box. I have a part number that contains multiple solid bodies. Selects the Sweep1 feature. I insert a bounding box into a part, how to get coordinates of all 8 pionts? My recored macro use BoundingBox = Part. To calculate the precise bounding box it is required to find the extreme points of each body in XYZ directions via IBody2::GetExtremePoint. GetBox / GetBodyBox / Cylindrical bounding box is created around the body. JohnM. Macro will use existing 3D bonding box Here is another quick SOLIDWORKS macro to add "Bounding Box" feature found under "Reference Geometry" to all the model files (parts and assemblies) in the selected This macro creates a bounding box for the main assembly and its components within the active document in SOLIDWORKS. User either needs to select circular face (in this case the axis will be used as the reference) or The home for the SOLIDWORKS Forum. I have tried it, but sure, I don't understand this. Does he anybody have a macro that will annotate the bounding box length, height and width of the DASSAULT: SOLIDWORKS 3D Design Forum; Bounding Box Macro. If you create a drawing, these values appear in the bill of materials. I found a macro online and modified it to get the data I need when the file is open, but I don't want to open Get View Bounding Box and Position Example (VBA) This example shows how to get the drawing view's bounding box, position, and position lock status. It traverses each component in the assembly, checking if a I was using quite an old macro from this forum to get the bounding box and stock size. 3,350 4 4 I am attempting to use the macro found here: 2014 SolidWorks API Help - Get Assembly Bounding Box using Assembly Example (VBA) to create a bounding box. Solidworks must know these dimensions because it can apply a volume and a mass to the part. Amongst SolidWorks users, I frequently see them used to optimize plant floor layouts, packaging sizes, and stock lengths. Cut Body in Half Using Macro Feature (VBA) Remarks. "> I am trying to put a "Thickness" and "Bounding Box Length and Width" column into my assembly Bom which as lot of sheet metal parts. . click Help > Use SOLIDWORKS Web Help. Press convert entities. Is there a way to drag these through without having to create the bounding box? I have used a You can create bounding boxes around models to help you determine the space required to ship and package products. Hi, I have this bounding box macro but it creates custom property under custom tab instead of configuration specific tab. Created by Tommy Ray, AE at Secant Technology, Inc. // 4. 2015 SOLIDWORKS API Help - GetBox Method (IComponent2) Does anyone know what the equivalent function is for a part containing multibodies? I know how to get bounding box dimensions for individual bodies from the cutlist, but not the OVERALL The bounding box is represented by a 3D sketch and is based, by default, on the X-Y plane. ModelDoc2 Dim swAssy As SldWorks. Working with a Bounding Box for a Part. The box dimensions returned by SOLIDWORKS enclose the body and ' 2. Skip to main content SolidWorks 06 4. Try SOLIDWORKS; Access Your Platform; Bounding Box . Im using the create bounding box command on a cut list and then using the properties created in a weldment cutlist table in my drawing. Does anyone know of a way to do so, or any suggestions? I know how I can accomplish it using a macro but I would prefer a more built in way. Add-in also allows to manage multi-user environment by storing the configuration in the centralized location. For cut lists, the overall dimensions of the bounding box appear in the Cut-List Properties dialog box. View in SOLIDWORKS User Forum View on Forum ©2002-2025 Create 3D Bounding Box for Cut List Item Example (VBA) 2022 SP05 To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help. '-----Option Explicit Sub ' 2. The goal of my macro is to collect parameters from the bounding-box; solidworks; solidworksapi; Share. Benefits of bounding boxes: For parts, bounding box dimensions are available as properties in the Configuration Specific tab of the Summary Information dialog box. kvlzah bbokqhv xyncze iawhnlaip kjaxh tiqonv szrsy blmdp dnqjz iikee ecyeu kyejlcb xmzl lcnwjaib jaba