Automatically add display data marks to default cfg

Here we have answers to common questions about SolidWorks. If you want to request or contribute answers, just flag down a moderator.
berg_lauritz
Posts: 423
Joined: Tue Mar 09, 2021 10:11 am
Answers: 6
x 439
x 233

Automatically add display data marks to default cfg

Unread post by berg_lauritz »

Is there a possibility to add a display data mark automatically to the first & only configuration?

Currently if we make new configurations (i.e. flat pattern) it won't automatically have a display data mark for the 1st configuration.

Adding new configurations will automatically add a display data mark though.

Am I doing something wrong? This feels like a bug.
User avatar
jcapriotti
Posts: 1897
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 32
Location: The south
x 1236
x 2029

Re: Automatically add display data marks to default cfg

Unread post by jcapriotti »

Yeah....not really a bug I guess but definitely not ideal. Best you can do is create two configurations for your template or have a sheet metal template with the flat configuration already in place.

Maybe you could submit as a bug. If you have two configs and add the display mark to both, then delete one so there is only one config, then add a second config back, the first no longer has the display mark.
Jason
User avatar
Hansjoerg
Posts: 115
Joined: Thu Apr 01, 2021 4:17 pm
Answers: 3
x 71
x 60

Re: Automatically add display data marks to default cfg

Unread post by Hansjoerg »

I've noticed this illogical behavior as well, don't understand the point of this function either.
With the function Mark for rebuild when saving it behaves exactly the same.

I have also tried to add the markers for the standard configuration already in the template. But if there is only one configuration, the function is not available.
Next, I tried to trick the system by creating a second configuration, setting the markers for the display status and for the rebuild, and then deleting the additional configuration. Unfortunately, the markers disappear in the remaining configuration again....
I have to check if it is possible to add the markers to a single configuration with a macro and then save it as a template.

But all in all, this is again a huge effort to find a workaround to make an insufficiently thought-out function usable.

My frustration level is steadily rising........ >>>
All the "good" news about SWX makes me feel like I'm driving a truck with two trailers straight into a dead end.
berg_lauritz
Posts: 423
Joined: Tue Mar 09, 2021 10:11 am
Answers: 6
x 439
x 233

Re: Automatically add display data marks to default cfg

Unread post by berg_lauritz »

Thank you @jcapriotti & @Hansjoerg for re-creating the same thing that I did & confirming that I have not gone mad.

I did the same & was very frustrated because I am not willing to create two configurations for parts that do not need more than one. I guess I'll have to live with it for now.
User avatar
jcapriotti
Posts: 1897
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 32
Location: The south
x 1236
x 2029

Re: Automatically add display data marks to default cfg

Unread post by jcapriotti »

berg_lauritz wrote: Mon Mar 28, 2022 9:07 am Thank you @jcapriotti & @Hansjoerg for re-creating the same thing that I did & confirming that I have not gone mad.

I did the same & was very frustrated because I am not willing to create two configurations for parts that do not need more than one. I guess I'll have to live with it for now.
Just an FYI, we are going away from having the Rebuild Markup as a default for all configurations and instead instructing users to do a Rebuild All Configurations before the final save. Reason for us is we have some automation and we are experiencing very long save times when saving an assembly where it decides to save some of the part/sub-assy files and has to rebuild a lot of configurations on every save. This is also related to Windchill so you may not have the same issue.
Jason
User avatar
gupta9665
Posts: 420
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 438
x 459

Re: Automatically add display data marks to default cfg

Unread post by gupta9665 »

How about using a macro to set the display data mark?
Deepak Gupta
SOLIDWORKS Consultant/Blogger
berg_lauritz
Posts: 423
Joined: Tue Mar 09, 2021 10:11 am
Answers: 6
x 439
x 233

Re: Automatically add display data marks to default cfg

Unread post by berg_lauritz »

gupta9665 wrote: Mon Apr 25, 2022 12:38 pm How about using a macro to set the display data mark?
Didn't you post a macro like that somewhere else? Can I link that to this post?
User avatar
gupta9665
Posts: 420
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 438
x 459

Re: Automatically add display data marks to default cfg

Unread post by gupta9665 »

berg_lauritz wrote: Wed Jun 08, 2022 1:48 pm Didn't you post a macro like that somewhere else? Can I link that to this post?
Try the following codes (the codes will add display data mark to each config in active model file)

Code: Select all

Option Explicit

Option Explicit

Sub main()
    Dim swApp As SldWorks.SldWorks
    Dim swModel As SldWorks.ModelDoc2
    Dim swConf As SldWorks.Configuration
    Dim swConfMgr As SldWorks.ConfigurationManager
    Dim configNameArr As Variant
    Dim configName As Variant
    
    
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    
    If Not swModel Is Nothing Then
        If Not swModel.GetType = 3 Then
            Set swConfMgr = swModel.ConfigurationManager
            configNameArr = swModel.GetConfigurationNames
            
            'Set Large Design Review marks for all configurations to true
            For Each configName In configNameArr
                Set swConf = swModel.GetConfigurationByName(configName)
                swConf.LargeDesignReviewMark = True
            Next
            swModel.ForceRebuild3 (False)
            
        End If
    End If
    
End Sub
Deepak Gupta
SOLIDWORKS Consultant/Blogger
woollyhayles
Posts: 2
Joined: Mon Sep 30, 2024 9:20 am
Answers: 0

Re: Automatically add display data marks to default cfg

Unread post by woollyhayles »

Hi there. This macro is perfect for what I need. Do you know how to modify it so that it can be used during a transition in Solidworks PDM?
Thanks
gupta9665 wrote: Fri Jun 10, 2022 1:21 pm Try the following codes (the codes will add display data mark to each config in active model file)

Code: Select all

Option Explicit

Option Explicit

Sub main()
    Dim swApp As SldWorks.SldWorks
    Dim swModel As SldWorks.ModelDoc2
    Dim swConf As SldWorks.Configuration
    Dim swConfMgr As SldWorks.ConfigurationManager
    Dim configNameArr As Variant
    Dim configName As Variant
    
    
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    
    If Not swModel Is Nothing Then
        If Not swModel.GetType = 3 Then
            Set swConfMgr = swModel.ConfigurationManager
            configNameArr = swModel.GetConfigurationNames
            
            'Set Large Design Review marks for all configurations to true
            For Each configName In configNameArr
                Set swConf = swModel.GetConfigurationByName(configName)
                swConf.LargeDesignReviewMark = True
            Next
            swModel.ForceRebuild3 (False)
            
        End If
    End If
    
End Sub
User avatar
AlexB
Posts: 508
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 29
x 274
x 462

Re: Automatically add display data marks to default cfg

Unread post by AlexB »

woollyhayles wrote: Mon Sep 30, 2024 10:26 am Hi there. This macro is perfect for what I need. Do you know how to modify it so that it can be used during a transition in Solidworks PDM?
You would have to put that scripted code into a Task (using the SWTaskAddIn & PDM Professional). Then during your transition, you can add an action that triggers the Task you've created.
woollyhayles
Posts: 2
Joined: Mon Sep 30, 2024 9:20 am
Answers: 0

Re: Automatically add display data marks to default cfg

Unread post by woollyhayles »

I've got the task created in the admin tool in PDM but I'm unsure on how to modify it to get it to work as it fails every time during the transition. I'm guessing it needs some additional code but I'm unsure on what or how to add it. Thanks
User avatar
DanPihlaja
Posts: 862
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 815
x 993

Re: Automatically add display data marks to default cfg

Unread post by DanPihlaja »

Probably the easiest solution is to create a dummy configuration in your part template (and/or assembly template).

Then apply the "rebuild on save" mark to both, then re-save your template.

Anyone who wants to can utilize the dummy config as needed. Or simply add a new config.
image.png
image.png (7.61 KiB) Viewed 1746 times
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
AlexB
Posts: 508
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 29
x 274
x 462

Re: Automatically add display data marks to default cfg

Unread post by AlexB »

woollyhayles wrote: Tue Oct 01, 2024 2:01 am I've got the task created in the admin tool in PDM but I'm unsure on how to modify it to get it to work as it fails every time during the transition. I'm guessing it needs some additional code but I'm unsure on what or how to add it. Thanks
Can you post the code that you're using?
User avatar
mp3-250
Posts: 654
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 735
x 357

Re: Automatically add display data marks to default cfg

Unread post by mp3-250 »

woollyhayles wrote: Tue Oct 01, 2024 2:01 am I've got the task created in the admin tool in PDM but I'm unsure on how to modify it to get it to work as it fails every time during the transition. I'm guessing it needs some additional code but I'm unsure on what or how to add it. Thanks
What is the error?
Beware You need to checkout the file to modify the content.
Post Reply