PDA

View Full Version : Delete sheet w/ multiple views


rbrennen
09-20-2005, 02:43 PM
I find myself periodically starting up new projects based on a previous bdl or drawing file and needing to delete some of the sheets without deleting the others. Deleting a complex sheet with lots of views can be time-consuming since the delete sheet command doesn't allow one to delete the sheet without deleting all of the contained views first. I don't really want to spend the time figuring out how to program this action so...

Is there a way to delete a single sheet with multiple views without having to delete all the views in that sheet one at a time? Or, failing that, is there a simple way to at once delete all the views within a sheet?

dorothea
09-20-2005, 10:54 PM
Hi,

Exactly this topic was discussed in a german forum some days ago. If you can read german, just have a look at:
http://ww3.cad.de/foren/ubb/Forum29/HTML/001679.shtml

Among others there is a reference to the goodies in OneSpace Designer:
"Delete Sheet inclusive all Views"

help/osdm/Common/documentation/goodies/Readme-0106.html

I think this should help already.

Regards,
Dorothea

John Scheffel
09-21-2005, 08:51 AM
This looks like a pretty handy function. I hope that CoCreate will consider making it a standard feature rather than an unsupported goody. It could use some enhancement, like a warning before deleting and updating the drawing browser afterwards. But it seems to do the job.

Heiko Engel
09-22-2005, 04:35 AM
Here (http://osd.cad.de/downloads/am_sheet_del.lsp) you can find a lisp-file with a warning (in german). Please feal free to change the code.
Heiko

rbrennen
09-22-2005, 07:01 AM
Thank you, John and Dorothea! This works great. It will fit directly into my work methods and use of previous designs.

I just noticed Heiko's post and script. I'll give that a try, too.

John Scheffel
09-22-2005, 01:55 PM
Here (http://osd.cad.de/downloads/am_sheet_del.lsp) you can find a lisp-file with a warning (in german). Please feal free to change the code.
Thanks for posting your function Heiko. This is much better but there seems to be some odd behavoir using ":selection *sd-anno-sheet-seltype*" for the Sheet variable. It does not allow typing the sheet number into the input field. I can select the current sheet from the viewport or other sheets from the drawing browser, but afterwards is just says "defined" and provides no feedback as to which sheet was selected.

I realize that this is a standard Modeling Lisp method that you have no control over, but I'm hoping some CoCreate Lisp wizard can suggest a better way to do sheet selection. Ideal would be something like the Sheet Renumber dialog which provides a drop down list of current sheets for the "Old Number" variable. Very easy to use and provides feedback on the sheet chosen. I tried to figure out how they did this, but it is beyond my Lisp skills.

Michael Kahle
09-23-2005, 01:27 AM
Here's how the renumbering works:

(oli::sd-defdialog 'am_sheet_select
:dialog-title "Sheet select"
:drawing-modified t
:variables
`(
(SHEET-NAME)
(SHEET
:value-type :docupart
:general-focus oli::*sd-anno-sheet-seltype*
:initial-value (setq sheet (oli::sd-am-inq-curr-sheet))
:title "Sheet"
:prompt-text "Specify the sheet."
:proposals (sort (mapcar #'(lambda (x) (oli::sd-am-sheet-struct-name (oli::sd-am-inq-sheet x)))
(oli::sd-am-inq-all-sheets)) #'oli::sd-string<)
:multiple-items nil
:gui-value (if sheet
(oli::sd-am-sheet-struct-name (oli::sd-am-inq-sheet sheet))
nil)
:after-input
(setq sheet-name (oli::sd-am-sheet-struct-name (oli::sd-am-inq-sheet sheet)))
)
)
)

John Scheffel
09-23-2005, 07:58 AM
Thanks for posting the code Michael, I will give it a try and report back. I wouldn't have figured this out on my own. I have never seen some of the options such as :general-focus, :proposals, or :gui-value. I had assumed it was done using :range.

John Scheffel
09-23-2005, 10:33 AM
By combining the input from Heiko and Michael I came up with the attached file. Thanks to both of them for contributing their code. I converted the prompts and messages to Engish, but feel free to use it and change to whatever language you want.

Try it out, I think you will like it. It allows selecting the sheet to delete from a drop down list of existing sheet numbers, from the viewport or from the Drawing browser. It provides feedback on the sheet number selected. It will post a warning when you click the OK button indicating which sheet you are about to delete, with Continue or Cancel options.

The only issue I could not fix is that if I delete any sheet other than the current sheet I get the error message.

LISP Error: NIL is not a structure

The function still seems to work, the sheet is deleted. I tried to track this down, but I don't think I can fix it. I get the same message if I delete a non-current sheet by entering am_sheet_delete on the command line. So I think this may be a defect in the am_sheet_delete function. I will report it to CoCreate support.

tom kirkman
09-27-2005, 10:35 AM
John

Your program works fine, and I do not get any errors as described.

I believe I know where your error is. It probably is in the Persistant Data files created by OSDM. I have had errors similar to this if I crashed out of OSDM and the peristant data file did not finish writing. Reset the persistant data under -> edit -> system settings -> save and see if this helps.

Tom

John Scheffel
09-28-2005, 09:11 AM
I believe I know where your error is. It probably is in the Persistant Data files created by OSDM. I have had errors similar to this if I crashed out of OSDM and the peristant data file did not finish writing. Reset the persistant data under -> edit -> system settings -> save and see if this helps.
Thanks for the suggestion Tom. I tried that but it didn't eliminate the error message. Further investigation indicates that this error is caused by something in our customizations, I don't see the error if I start Modeling and Annotation without them. I haven't found the source yet, but it seems that it is not a defect in Annotation itself.

rbrennen
10-24-2005, 12:56 PM
Thanks, again, everyone. This capability is great!