Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods that use 3DExperience #50

Open
7 of 9 tasks
brinkdinges opened this issue Nov 26, 2024 · 5 comments
Open
7 of 9 tasks

Add methods that use 3DExperience #50

brinkdinges opened this issue Nov 26, 2024 · 5 comments

Comments

@brinkdinges
Copy link
Member

brinkdinges commented Nov 26, 2024

I'm not a big fan but more and more companies use SolidWorks Connected (aka 3DEXPERIENCE SOLIDWORKS, it has two names). So we need to support it better.

  • Open file
  • Save file
  • Get custom property
  • Model source program
  • Connection status
  • Get ID from model
  • Get ID from component
  • Batch save files: skip for now
  • Make model 3DX compatible? Skip for now, no idea what it does.
@brinkdinges brinkdinges changed the title Add methods for opening and saving from 3DExperience Add methods that use 3DExperience Nov 26, 2024
@brinkdinges
Copy link
Member Author

brinkdinges commented Nov 26, 2024

Custom properties work out of the box, I don't think we need extra helpers for this.

3DExperience-only properties are only available in configurations, not on the file level. The platform properties are accessed with the $PRLPRP command, so similar to the old $PRP and $PRPModel commands.

If a custom property contains such a field, SolidWorks desktop shows three asterisks and does not reload its value:
image

@brinkdinges
Copy link
Member Author

brinkdinges commented Nov 27, 2024

Saving seems fundamentally broken. I've been testing IModelDocExtension.SaveTo3DExperience
https://help.solidworks.com/2025/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelDocExtension~SaveTo3DExperience.html

What works

  • If you save a new file and pass null for the options object, it receives a filename specified by your company. That's fine.
  • If you save a new file and pass a filename using the options object, the file gets that filename. Great.

What doesn't work

  • The user gets a popup. If they do not confirm this popup, the file gets saved locally under that filename but does not get uploaded to 3DX. Pretty useless. I have to check if the return value is true or false.
  • If you pass a new filename for a saved file, it is supposed to be a Save As New (aka save as). But this doesn't happen. It returns true but the file doesn't appear locally or on 3DX.
  • The filename needs to be unique on the whole platform. Great for solidworks but a stupid requirement for stuff in database.
  • If you tell it to use "filename3" and that file already exists, it magically saves the file as "filename4". What 🤯 No errors or warnings.
  • There is a method "SetRevisionComments". From what I can see, this comment doesn't make its way to 3DX.
  • I haven't seen it return false, or a warning, or an error. None at all.

@brinkdinges
Copy link
Member Author

I've added the "3DExperience model type" property. It actually contains the program that was first used to create this model. So if you create it in solidworks desktop and upload it to 3DX, it still says "Standard". I think Standard is a useless name so I mapped it to SolidWorksDesktop.

https://help.solidworks.com/2025/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelDocExtension~Get3DExperienceModelType.html

@brinkdinges
Copy link
Member Author

The connection status seems to work fine. I wish there was an event when the status changes, but that doesn't exist.

@brinkdinges
Copy link
Member Author

Added getting the PLM ID for a Model and Component with 2bb1d84. I don't like the name, but starting properties with a 3 is impossible and a new name would cause even more confusion so I kept it this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant