Cultural Change - How some people view change
Just some fun stuff... Enjoy!
Just some fun stuff... Enjoy!
Huh, what was that? There is a little known feature of SolidWorks called the Document Manager Dll, and it is actually very well documented! A few years ago I ran across a posting about how programmers were able to extract custom property information from a SolidWorks part file without having SolidWorks open. As I looked into it further, I found that this was done by accessing a special dll named SwDocumentMgr.dll.
If you have SolidWorks installed, the actual dll can be found in the C:\Program Files\Common Files\SolidWorks Shared directory.
So, what can you do with this little wonder object?
- You can Get and Set the custom/configuration specific properties.
- You can Get and Set references in an assembly file. (Very powerful, and scary!)
- You can extract the parasolid (The solid model).
- You can extract the preview Bitmap. Yes, that is pretty sweet!
- You can extract eDrawing data.
- You can extract data out into an xml format. (Basically, export xml of all sub parts and assemblies, etc.)
The documentation on its capabilities, API, and example code can be found in your SolidWorks directory. On my computer, it can be found here:
C:\Program Files\SolidWorks\api\swdocmgrapi.chm
You don't have to be a rocket scientist to use the dll. It is COM based, and simple to consume in your application.
If you are using vb6 or .Net, make sure you reference the SwDocumentMgr 200x type library.
Probably the biggest caveat to using the dll is that you need a key. Without the key the application will fail. I have read somewhere that any file after 2007 doesn't need a key. However, I haven't tried this. You can easily get a key though. Just email apisupport@solidworks.com. They will be glad to set you up with one. You may need to be an existing customer though.... not sure on that one.
With just a few lines of code, and more importantly, without starting (or even having) SolidWorks you can accomplish some very cool things!
' Get the Document Mgr application Object.
classfac = CreateObject("SwDocumentMgr.SwDMClassFactory")
DMapp = classfac.GetApplication("your_license_key")
' Get the document mypart.sldprt. Then grab the configurationmanager object for the default configuration
swDoc = DMapp.GetDocument("C:\MyPart.SLDPRT", swDmDocumentPart, True, e)
c = swDoc.ConfigurationManager.GetConfigurationByName("Default")
' Grab the custom property "MyDimension" for the Default configuration!
Debug.WriteLine(c.GetCustomProperty("MyDimension", e))
Contact Inflow Technology for more information.
This is a release we at InFlow have been looking forward to for a while. SolidWorks Corporation today unveiled PDMWorks Enterprise 2008. SolidWorks has done a great job of listening to what is going on in the field and improving an already strong product. We will be talking about the specifics as time goes on, but to give you a taste of whats new ...
Improved support of SolidWorks Configurations
This has gone from a weak spot for PDMWE to a true strength. The new version allows access to the structure of each configuration without launching SolidWorks. This information can also be used to create reports and BOMs.
Better control and management of Bills Of Materials(BOMs)
Multiple BOMs now be created for for an assembly. For example, you can have a separate BOM for as designed, as Manufactured, as Serviced, etc.
BOMs can be routed through work flow. This allows you to route them for approvals or distribution and more.
Using the PDMWE, multiple people can review and edit BOMs without installing SolidWorks. This allows non CAD users contribute to the BOM creation process.
BOMs can now include units of measure.
Improved Connectivity to External Systems
Many companies we talk to put integration to external business systems (ERP) high on the list of priorities. PDMWE 2008 makes a bigger piece of this task a configurable tool rather than a customization. Communication can be triggered manually, or via a work flow. Communication is done via XML files. This process is bi-directional. As an example, this capability can be used to send BOM information to your ERP system and get costing information pushed back into PDMWE.
Improved replication across multiple sites
PDMWorks Enterprise 2008 features faster, more powerful replication of design files across distributed organizations. It optionally replicates only the latest version of design files for faster, less processing-intensive downloads. New capabilities enable design engineers to easily find the current version of any part or project, eliminating confusion and errors.
Other improvements:
There is a lot more to discuss. More to come.
I am a PLM sales person…and the title of this blog entry may imply that I am whining about my job. While I am not immune to the occasional emotional episode / mild tantrum, the title of this blog entry has a purpose. I assure you that this purpose has nothing to do with my emotional state.
Companies that contact InFlow are generally not looking to buy a PLM solution. Rather, they are looking to solve complex issues in their organization. Often times, the connection between the issue and the definition of PLM is somewhat cloudy. Therefore, my goal in this series is to discuss some of these challenges that InFlow has addressed with PLM and some of the measurable success that our customers have achieved.
"Change, for lack of a better word, is good"
Excuse the cheap Gordon Gecko rip-off...but who else would you expect a sales guy to quote? Change in any organization can be viewed as a good thing. That is, unless you are the poor sap that has to deal with all of this change.
ECRs, or Engineering Change Requests, are the way that many companies request product and design changes within the product development group. ECRs are product development’s answer to the corporate suggestion box: They allow anyone from any department to recommend a product change in a formal manner.
ECRs are encouraged. Many companies believe that their people should have as much input into product line improvements as market research studies and customer demand.
One of InFlow’s customers encourages this type of input from its employees…they posted sheets outside of the VP of Engineering’s office that were filled out and dropped in his mailbox. This encouragement was not ignored…the VP processed an average of 15 ECRs per week. The unfortunate part of this story is the process by which these ECRs were…well, processed. The VP had to complete 50 manual steps before beginning the approval of an ECR. These tasks included attaching documentation to support the change, reviewing inventory levels in the ERP system, filling out his form that mirrored the employees’ request, and determining the approval route.
Recently, this InFlow customer implemented PDMWorks Enterprise, a Data Management solution developed by Solidworks Corporation. Working with the InFlow team, the customer formalized the ECR process, created submittal and approval forms inside the system, and has created an automated notification system that routes the forms to the proper approvers. This was completed in a little less than 3 weeks, and the results have been fantastic: All 50 manual steps have been eliminated from the ECR process. Furthermore, the submittal process happens online and is much easier for employees to access and complete. The result: The customer is completing 3 times as many ECRs. However, their backlog of active ECRs has decreased by over 50%. The company is generating more ECRs and processing them faster and more efficiently.
Gordon Gecko also said, “Lunch is for wimps.” Be that as it may, our VP of Engineering certainly now has more time to take a well deserved lunch. Enjoy.
Do you have code that uses Block or Symbol insertions? If so, then this Blog is for you!
It seems that something has changed in the New SW2007 API. We are working with SW to further understand what has changed.
In the past, we were able to simply insert Blocks fairly easy
swModel.EditSketch
Set BlockInstance1A = swModel.InsertBlock("c:\flat_coated.SLDBLK", 0.0254, 0.0254, 0, 0#)
Here is a sample bit of code that seems to work fine now for Blocks:
Private Sub Command2_Click()
Dim swModel As SldWorks.ModelDoc2
Dim BlockFName1 As String
'Attach to running instance of SolidWorks
If swApp Is Nothing Then Set swApp = GetObject(, "SldWorks.Application")
Set swModel = swApp.ActiveDoc
Dim BlockInstance1A As SldWorks.BlockInstance
Dim swSketchBlockDef As SldWorks.SketchBlockDefinition
Dim swSketchMgr As SldWorks.SketchManager
Dim swMathUtil As SldWorks.MathUtility
Dim swMathPoint As SldWorks.MathPoint
Dim nPt(2) As Double
Dim vPt As Variant
Dim vInstPt As Variant
Set swSketchMgr = swModel.SketchManager
Set swMathUtil = swApp.GetMathUtility
'Define insertion point
nPt(0) = 0.02
nPt(1) = 0.02
nPt(2) = 0#
vPt = nPt
Set swMathPoint = swMathUtil.CreatePoint(vPt)
Set swSketchBlockDef = swSketchMgr.MakeSketchBlockFromFile(swMathPoint, "c:\flat_coated.SLDBLK", False, 1, 0)
Set BlockInstance1A = swModel.SketchManager.InsertSketchBlockInstance(swSketchBlockDef, swMathPoint, 1, 0)
End Sub
----------------------------------------------------------------------------------------------------
In an exisitng bit of code for symbols, I was doing:
BlockFName1 = "c:\CHECK.SLDSYM"
swModel.InsertCustomSymbol BlockFName1
and all was working fine. Now with SW2007 SP3, I can not get it to insert sybols at all and have been forced to switch everything to Blocks.
I hope you find this entry informative and it can help you avoid a couple of pit falls that I was not able to dodge!
Thanks,
Scott Evans
Please contact Inflow tehnology @ www.inflow-tech.com for more information
If you get .DLL register errors and on your old 32-bit system the fix was to put them into the System32 dir and register them, try dropping it into the SysWOW64 folder instead.
For those that don't know, WOW means Windows On Windows. This has been around since we went from
What is PLM Really? It has been defined and redefined by the
marketing departments of many companies. The definitions chosen depend on the
definer. The ERP (MRP II (MRP)) companies like to push PLM in the BOM
direction, a position of strength for them. The CAD companies lean toward the
file management & workflow, topics more in their wheelhouse. Personally, I
think the term has been rendered useless. So, I will bravely step into the void
left by so much marketing effort on three little letters and declare, with apologies
to our president, "I am the definer". What can I hurt at this point?
Product Lifecycle Management (PLM)
Welcome to the Inflow Technology Blog!
Here you will find leading industry information regarding PDM and PLM.
We will also be hosting specific product information on;
SmarTeam, PDMWorks Workgroup, PDMWorks Enterprise, DriveWorks, and even SolidWorks!
Recent Comments