PDA

View Full Version : How to change details info on One Space Designer Modeling from lisp code


alexniccoli
03-17-2004, 01:57 AM
Hi all
If i launch Model Manager from One space designer modeling,in the details window appear the column Masterdata.

Can i set a value on this column on the current part?
thanks a lot

Alessandro Niccoli

May Kung
03-18-2004, 09:40 AM
Are you trying to change the Masterdata attribute for the part (i.e. change its Masterdata parent) or do you want to edit the Masterdata information itself (change its name, but retain the parent/child relationship)?

You should be able to change Masterdata information through DB properties, then checking the Edit checkbox in the right.

If you want to change the part's Masterdata parent, it should be Remove from Parent. In Workspace, find the Masterdata parent, expand it to show the child part, right click, and you should have this option.

At least, I *think* that's how it's done. I just finished the class two days ago so this is all pretty new to me. :)

alexniccoli
03-19-2004, 05:11 AM
thanks a lot May Kung.
I create this thread because i don't like how model manager creates bom.It works fine if there is only one part class in the database.
But not if there are more than one part class.

Infact model manager during the creation of the bom,creates one part(always in the same class) for each model that compose the assembly.
I don't agree with this idea,because:
1-Using more part classes is more flexible of using one part class.
2-in some cases users want to create pdm part and than want to model the assembly.

So i think that the best way to solve this problem is to put hand on java code(i have done during this week),in particular on classes:
Part
DocWithParts.
I follow this idea modifing java code:
when user create the bom of an assembly, java code try to search if there is a part item(in a part class) with NAME equal to model's INSTANCE_NAME.If java code found it,it links the part to the model(and also to the part linked to the assembly),else it create a part in a defaullt part class and links it to the model and to the part linked to the assembly(in this case the part NAME is obtained concatenating INSTANCE_NAME + "-" + ELID of the model).

I think that this is very similar to Workmanager "Maps parts by name".

excuse me for my english.

Alessandro Niccoli

dszostak
03-22-2004, 09:05 AM
FYI - As of 12.0, Model Manager does handle multiple part classes, no extra Java coding required. There are 2 ways - automated selection of the part class that requires coding the class name manager. This is really the preferred method because the user is not given the opportunity to make a mistake.

The other is to allow the user to select the part class for new entries at save time. This does not require coding. The user must right button click, select the layout manager and display the PartClassName attribute. If multiple part classes have been configured in the xml file, a drop down list of the part classes will be displayed and the user can select the part class they want.

Please call CoCreate Support if you need further details.

alexniccoli
04-05-2004, 11:20 PM
Originally posted by dszostak
FYI - As of 12.0, Model Manager does handle multiple part classes, no extra Java coding required. There are 2 ways - automated selection of the part class that requires coding the class name manager. This is really the preferred method because the user is not given the opportunity to make a mistake.

The other is to allow the user to select the part class for new entries at save time. This does not require coding. The user must right button click, select the layout manager and display the PartClassName attribute. If multiple part classes have been configured in the xml file, a drop down list of the part classes will be displayed and the user can select the part class they want.



thank you very much but i'm very happy with my "Maps parts by name" during Bom Creation.
You said that Model Manager supports more than one class.I think that you need some more testing. :-))
Try to create a simple bom A(in class C1) with child C (in class C2) and class C1 have an attribute (ATTR1) that C2 havent't.
If you press Tab "Consolidated Bom" in Bom Editor there is an Error.
Here is a patch.
In method private WMLtab getBomLtab(boolean, boolean) of class
com.osm.datamgmt.report.tab.ConsolidatedBOMtab
//old code
for (int j = 0; j < bom.numColNames(); j++) {
String attName = bom.getColumnName(j);

if (attName.equals(isAssembly)) {
bom.write(row, isAssembly, p.isAssembly());
} else if (attName.equals("TOTAL_QTY")) { // don't localize
bom.write(row, attName, getConsolidatedTotalQty(p));
} else if (consolidatedLinkValues.containsKey(attName)) {
bom.write(row, attName, getConsolidatedLinkValue(attName, p));
} else if (p.isElementAttribute(attName)) {
bom.write(row, attName, p.getValue(attName));
} else if (p.getParentLink() != null) {
bom.write(row, attName, p.getLinkValue(attName, false));
}
}

//new code

for (int j = 0; j < bom.numColNames(); j++) {
String attName = bom.getColumnName(j);

if (attName.equals(isAssembly)) {
bom.write(row, isAssembly, p.isAssembly());
} else if (attName.equals("TOTAL_QTY")) { // don't localize
bom.write(row, attName, getConsolidatedTotalQty(p));
} else if (consolidatedLinkValues.containsKey(attName)) {
bom.write(row, attName, getConsolidatedLinkValue(attName, p));
} else if (p.isElementAttribute(attName)) {
bom.write(row, attName, p.getValue(attName));
} else if (p.getParentLink() != null) {
//bom.write(row, attName, p.getLinkValue(attName, false));

try{
Object objApp = p.getLinkValue(attName, false);
bom.write(row, attName, objApp);
}
catch (WMException e){
bom.write(row, attName, null);
}

}
}

dszostak
04-06-2004, 09:18 AM
Your code is correct (good job) and with the v12 release of Model Manager, we tested the multiple part class support for all situations that were given to us by current customers. Currently we are testing more situations and improving the code with every new release. As with any software feature, we need customer feedback and that's the important reason to call customer support (Believe it. We track and review every call). The correct feedback through the correct channels will get faster results in the software.

alexniccoli
01-03-2005, 12:17 AM
Your code is correct (good job) and with the v12 release of Model Manager, we tested the multiple part class support for all situations that were given to us by current customers. Currently we are testing more situations and improving the code with every new release. As with any software feature, we need customer feedback and that's the important reason to call customer support (Believe it. We track and review every call). The correct feedback through the correct channels will get faster results in the software.

With release 13 of Model Manager java code is the same.

I repeat that ConsolidatedBOMtab don't manage situations of bom composed of items that belongs to multiple classes ad top part item's class have an attribute that a class of a children item don't have.
The correction to java code is up into the thread.

thanks