PDA

View Full Version : Create a new drawing


sstaabs
09-14-2005, 01:16 PM
Hello All,

We are struggling with the program selecting the part name (Description) as the drawing number instead of the part number (Model Name).

Is there a way to create a macro that inputs the part number in the drawing number field at creation of the drawing.

If so how can this be done?

Thanks in advance,

Steve

May Kung
09-14-2005, 04:44 PM
Are you using Model Manager? I have a text reference in my drawing frames that tells it to pull the part number from Model Manager and populate the drawing number field.

sstaabs
09-15-2005, 05:17 AM
Hello May,

Yes we are using Model Manager. Would you mind sending me the customization to see if we could implemnet it here?

Thanks,

Steve

Wolfgang
09-28-2005, 01:28 AM
Hi Steve,

have a look to your am_customize file in OSD installataion dir structure. You will find:

> Example: control the stragegy to generate a new drawing number
> (defun get_my_new_drawing_name....

what you are looking for AFAIK is
...(oli::sd-inq-obj-contents-name (sd-am-inq-drawing-selected-owner))..

One idea might be:

....
(if (sd-am-inq-drawing-selected-owner)
(or
(oli::sd-inq-obj-contents-name (sd-am-inq-drawing-selected-owner))
(oli::sd-inq-obj-basename (sd-am-inq-drawing-selected-owner))
)
nil
)

with the function name as 1st strategy for (AM_SET_DEFAULT_DRAWING_NUMBER ...

HTH

May Kung
09-28-2005, 10:11 AM
Hello May,

Yes we are using Model Manager. Would you mind sending me the customization to see if we could implemnet it here?

Thanks,

Steve
It isn't a customization file, but something that's embedded in the drawing frame. You can assign Text References from Annotation. When you Assign a Text Reference, make sure to select from the tb group. This shows a list of possible Text References you can assign to a particular text field.

Once that's done, I just make sure the frame is Registered in my am_customize file.

sstaabs
09-29-2005, 05:08 PM
Hello May,

I will try your suggestion when we are ready to change the titleblocks.

Hello Wolfgang,

I just don't understand how to get this to work. I found the section in the am_customize file to change the strategy but I don't understand how to set this.

> Example: control the stragegy to generate a new drawing number
> (defun get_my_new_drawing_name....

....
(if (sd-am-inq-drawing-selected-owner)
(or
(oli::sd-inq-obj-contents-name (sd-am-inq-drawing-selected-owner))
(oli::sd-inq-obj-basename (sd-am-inq-drawing-selected-owner))
)
nil
)

Thanks for any help

Steve
10-03-2005, 01:55 PM
I think May is talking about something different then you are:

May is talking about (I think) setting up Reference Text on his drawing formats so that the drawing number that shows up in his formats references the Model Manager database field for "Model Name". This will, of course, make your drawing formats show the drawing number to be whatever you have input for the Model Name in the database.

What I think you are looking for, however, is to have the actual drawing number default to the Model Name. I haven't tried Wolfgang's approach, but it sounds like that is the functionality you are after.

Steve

P.S. - of course, once you actually get Wolfgang's technique to work, your Reference Text on your drawing can actually refer to the Model Manager database field for "Drawing Name", since it will then be correct.

Steve

sstaabs
10-04-2005, 06:52 PM
Thank you Steve for your response.

I am trying to say that I do not understand the technique that Wolfgang was explaining above.

I don't understand this command. Can you show me it with an example of how to have the drawing be created with the Model name as the drawing number instead of the Description (Part Name)?

We already use text references to link to Model Manager for some of the titleblock information.

Thanks a lot.

Andy Poulsen
10-04-2005, 07:59 PM
Hi Steve,

I think the missing piece of the puzzle is how to put it all together. As Wolfgang mentioned, you need a function that will get the Contents ID if it exists, and if not, to use the Part Name. The function in simple form can be something like this (from Wolfgang's post, but putting it with the function definition line):
(defun am-new-dwg-cid-name ()
(if (sd-am-inq-drawing-selected-owner)
(or (oli::sd-inq-obj-contents-name (sd-am-inq-drawing-selected-owner))
(oli::sd-inq-obj-basename (sd-am-inq-drawing-selected-owner)))
nil))and then the function that actually does the magic is am_set_default_drawing_number, which can take a list of "strategies" for how to get this number. In the simplest case (which will most likely be all you need), you just want to use the function that you defined above, which is done with the function call:(am_set_default_drawing_number 'am-new-dwg-cid-name)Give this a shot and let me know how it goes.

I hope this helps to make things a little more clear!

sstaabs
10-05-2005, 04:31 PM
Thanks Andy, this worked great

Wolfgang
10-06-2005, 11:13 AM
Hi Andi,
Hi Steve,

sorry for not answering earlier. But sometimes I do not look into different (CAD) forums for serveral days (or some weeks). Well, I saw that Andy picked up my idea how to do it.. So thanks for continue this.

Wolfgang