cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Have a setting to have the "One Level" option be the default for the Copy command

Have a setting to have the "One Level" option be the default for the Copy command

Ideally this should be the default because if you have it set by mistake, it is easy to fix by using the "Unshare" command on all items that shouldn't be shares. If that option is off (like the default is now) by mistake, it is VERY DIFFICULT to fix this later-there isn't a good way to take a copy of a part and make it a share instead; the only option is to start over.

4 Comments
nusseckenfresse
6-Contributor

Hello Peter,

you can ad the following commands to your sd_customize:

;; copy part or Assembly:

(copy-default :onelevel) ; one level

;; (copy-default :deep) ; all levels

;; keep attribute shared parts

(share-default :keep_attr)

;; (share-default :cut_attr)

;; unshare

(unshare-default :onelevel)

; (unshare-default :deep)

just have a look to the German help page

Unofficial Help Page about SolidDesigner - Tips and Tricks

regards, Uwe

PeterKehoe
5-Regular Member

Thanks for that tip; I did not know those options were available.

PeterKehoe
5-Regular Member

Using that information, I came up with a function to set the defaults for both-defaults that will be kept for the next session. (All the information below should be saved to a file and loaded using the 'sd_customize' file.)

(in-package :my-package)
(use-package :oli)

(sd-defdialog 'Copy_Share_options
  :dialog-title "Set Copy/Share Options"
  :toolbox-button t
  :variables
  '(("Copy Default")
     (One_level :value-type :boolean
   :title "Copy One Level (share subs)"
   :toggle-type :wide-toggle
   :initial-value (oli:sd-get-persistent-data "ALL" "CopyOneLevel" :default nil)
   )
(Deep :value-type :boolean
   :title "Copy All Levels"
   :toggle-type :wide-toggle
   :initial-value (oli:sd-get-persistent-data "ALL" "CopyOneLevel" :default t)
   ) 
   ("Share Default")
     (Keep_Attr :value-type :boolean
   :title "Keep Attributes On"
   :toggle-type :wide-toggle
   :initial-value (oli:sd-get-persistent-data "ALL" "KeepAttr" :default nil)
   )
(Cut_Attr :value-type :boolean
   :title "Keep Attributes Off"
   :toggle-type :wide-toggle
   :initial-value (oli:sd-get-persistent-data "ALL" "KeepAttr" :default t)
   ) 
  )
:mutual-exclusion '((One_level Deep) (Keep_Attr Cut_Attr))
:ok-action '(progn
    (if One_level
     (progn
      (mei::copy-default :onelevel)
      (oli:sd-set-persistent-data "ALL" "CopyOneLevel" t)
     )
     (progn
      (mei::copy-default :deep)
      (oli:sd-set-persistent-data "ALL" "CopyOneLevel" nil)
     )
    )
    (if Keep_Attr
     (progn
      (mei::share-default :keep_attr)
      (oli:sd-set-persistent-data "ALL" "KeepAttr" t)
     )
     (progn
      (mei::share-default :cut_attr)
      (oli:sd-set-persistent-data "ALL" "KeepAttr" nil)
     )
    )
   )
)


(if (oli:sd-get-persistent-data "ALL" "CopyOneLevel" :default nil)
(mei::copy-default :onelevel)
(mei::copy-default :deep)
)

(if (oli:sd-get-persistent-data "ALL" "KeepAttr" :default nil)
(mei::share-default :keep_attr)
(mei::share-default :cut_attr)
)

olivierlp
Community Manager
Status changed to: Archived

Hello,

We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.

You can always post a new idea with all the details required in the form.

Thank you for your participation.