AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting COILPINS, MAXNO, MAXNC with c:wd_rtrn_2wd

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
AdrianSaf
602 Views, 7 Replies

Setting COILPINS, MAXNO, MAXNC with c:wd_rtrn_2wd

Hello,

 

I'm using AutoCAD Electrical 2014 and have set WD_XCAT in the env file so that I can use a custom database fetch lsp script to get catalog data.

I can set atributes like "TAG1" by sending it to c:wd_rtrn_2wd in the parameter list for the method.

 

Does anyone know how I can set MAXNO, MAXNC and COILPINS (I need to read them from the custom DB and send them back to the AutoCAD insert component dialog)? (I tried sending them in the list but they are not updated - used both MAXNO, MAXNC and VIA_WD_MAXNO, VIA_WD_MAXNC).

 

Also where is there any document/help file that describes c:wd_rtrn_2wd (I did not find it in the LISP API help file) - the only reference I have are the comments in wd_xcat.lsp.

 

Thank you.

7 REPLIES 7
Message 2 of 8
AdrianSaf
in reply to: AdrianSaf

A bit more information of what i'm doing. I have the folowing set-up:

 

code in wd_xcat.lsp:

(setq retList (c:POCLispCatalog))
(c:wd_rtrn_2wd retList)

 

code in c# add in fot the actual method:

[LispFunction("c:POCLispCatalog", "POCLispCatalogLocal")]
 public ResultBuffer POCLispCatalog(ResultBuffer args) 
 {
    ResultBuffer retVal = new ResultBuffer();
    retVal.Add(new TypedValue((int)LispDataType.ListBegin));
      retVal.Add(new TypedValue((int)LispDataType.ListBegin));
        retVal.Add(new TypedValue((int)LispDataType.ListBegin));
          retVal.Add(new TypedValue((int)LispDataType.Text, "SCH"));
          retVal.Add(new TypedValue((int)LispDataType.Text, ""));
          retVal.Add(new TypedValue((int)LispDataType.Nil));
          retVal.Add(new TypedValue((int)LispDataType.Nil));
          retVal.Add(new TypedValue((int)LispDataType.Nil));
          retVal.Add(new TypedValue((int)LispDataType.Int16, 1));
          retVal.Add(new TypedValue((int)LispDataType.ListEnd));
          retVal.Add(new TypedValue((int)LispDataType.ListBegin));
          retVal.Add(new TypedValue((int)LispDataType.Text, "SCH"));
          retVal.Add(new TypedValue((int)LispDataType.Text, "327"));
          retVal.Add(new TypedValue((int)LispDataType.Text, "11111"));
          retVal.Add(new TypedValue((int)LispDataType.Text, "1"));
          retVal.Add(new TypedValue((int)LispDataType.Text, "HDS11FL"));
        retVal.Add(new TypedValue((int)LispDataType.ListEnd));
        retVal.Add(new TypedValue((int)LispDataType.Nil));
        retVal.Add(new TypedValue((int)LispDataType.ListBegin));
          retVal.Add(new TypedValue((int)LispDataType.ListBegin));
            retVal.Add(new TypedValue((int)LispDataType.Text, "TAG1"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "XREFNO"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "XREFNC"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "MAXNO"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "MAXNC"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "COILPINS"));
          retVal.Add(new TypedValue((int)LispDataType.ListEnd));
          retVal.Add(new TypedValue((int)LispDataType.ListBegin));
            retVal.Add(new TypedValue((int)LispDataType.Text, "TAG_FROM_CODE"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "7"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "1"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "2"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "8"));
            retVal.Add(new TypedValue((int)LispDataType.Text, "K11,K12;"));
          retVal.Add(new TypedValue((int)LispDataType.ListEnd));
        retVal.Add(new TypedValue((int)LispDataType.ListEnd));
      retVal.Add(new TypedValue((int)LispDataType.ListEnd));
    retVal.Add(new TypedValue((int)LispDataType.ListEnd));

    // Return a value to the AutoCAD Lisp Interpreter
    return retVal;
}

 

The result is that the data is added as XRecords for the object all with "VIA_WD_" in front of the atribute names.

Message 3 of 8
PatMurnen_Adsk
in reply to: AdrianSaf

AdrianSaf,

 

I am running into some issues with assigning these extra attribute values.

 

For MAXNO and MAXNC you should be able to assign these the same way as the other values. If the attribute does not exist, AutoCAD Electrical adds the VIA_WD_ prefix and saves it as xdata on the component. One thing I did see when I tried this was that even though the values are assigned to the component you need to OK out of the Insert\Edit dialog and then edit it again to see it reflected in the dialog. What I mean is this -

 

1. You edit a component
2. You pick Lookup and your own catalog function is called, values are returned and assigned to the component
3. OK out of the dialog
4. Edit the same component
5. Pick NO\NC Setup you will see the values there

 

They are getting placed on the component so should be used from that point on so I don't think it is affecting the functionality besides not seeing them in the dialog.

 

But, for the COILPINS I think you want to assign those to the actual terminal pins, TERM01=K1 and TERM02=K2. The function works ok and assigns the values to the attributes but as soon as you OK out of the Insert\Edit dialog the values are lost. But, if you Cancel out of the Insert\Edit dialog the changes are actually maintained. They must be written to the component as soon  as it is returned from your custom catalog lookup.

 

I will log both these issues. 

 

Regards,

Pat Murnen



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 4 of 8

Correction - even the MAXNO and MAXNC are lost if you OK out of the Insert\Edit dialog. They are all maintained if you Cancel out of the dialog. The issues are now logged.

 

Regards,

Pat Murnen



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 5 of 8
AdrianSaf
in reply to: PatMurnen_Adsk

Hello Pat,

 

Thank you forthe answer. Is there a website I could track these issues? (some links to them)

 

Thank you.

Message 6 of 8
PatMurnen_Adsk
in reply to: AdrianSaf

If you are a subscription customer you can log this through that route as well and then you have some insight into the status. Otherwise, there is not a link to the issues that have been logged. You can watch for any hotfixes or service packs to see when an issue is addressed.

 

Regards,

Pat Murnen



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 7 of 8
AdrianSaf
in reply to: PatMurnen_Adsk

Hello Pat,

 

Can I do the same if I'm an ADN (Autodesk Developer Network) member.

 

Thank you.

Message 8 of 8
PatMurnen_Adsk
in reply to: AdrianSaf

I don't think so but I will try and find out. The best thing to do is watch service packs and hot fixes. You should get notifications when these are released.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost