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: 

User Post 3 lisp: Duplicating Item Numbers

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
matthewjohnston4386
2750 Views, 7 Replies

User Post 3 lisp: Duplicating Item Numbers

Hello,

 

I was wondering if anyone could help me. I'm running AutoCAD Electrical 2013 and using the Bill of Materials Report for Panels. I notice that when a sub assembly is listed in the BOM, It comes under the parent part, but it does not get an Item number. This makes sense because it's the same item number as it's part of the same part. Is there any way to make a user post to copy the item number from above and push it into the table? Yes you would have duplicate Item numbers but it wouldn't be incorrect as they point to the same thing on the drawing. I tried writing it myself using the User Post 2 as an example but it keeps failing.  Any help would be appreciated.

 

 

Matthew Johnston
Sr. Controls Scientist
Corning Inc.
7 REPLIES 7
Message 2 of 8

I think the attached file will work as user function 3. Basically it reads the item value and saves it in a variable to compare to the next record. It also saves the drawing index (dwgix) and the handle to from the record so it can compare and make sure that the next record is for the same component and not just a component with a blank item value.

 

Anyway, give it a try and see if it does what you want. I didn't do much testing so it might need some tweaking.

 

Make sure to rename it to bompnl.lsp and place it in the support folder it came from.

 

Regards,

Pat Murnen



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

Autodesk, Inc.

Message 3 of 8

Pat,

 

Thank you so much, this works perfectly!

 

 

Matthew Johnston
Sr. Controls Scientist
Corning Inc.
Message 4 of 8

Matthew,

 

Glad that worked out.

 

Regards,

Pat



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

Autodesk, Inc.

Message 5 of 8

Pat,

 

I was wondering if you know how to change the dialog for the User Post options.  Right now, options 1 and 2 are the defaults and say what they do. Optoin 3 just says "user post 3". I checked the LISP, but the dialog is not getting it from here. Do you know where I can edit this?  Thanks.

 

 

Matthew Johnston
Sr. Controls Scientist
Corning Inc.
Message 6 of 8

Sure. Each user post .lsp file has a matching .dcl file that defines the dialog. So the bompnl.lsp file has a bompnl.dcl file in the same folder. You can edit this with a simple text editor like Notepad.

 

In the default bompnl.dcl look for -

 

:toggle{key="user3";
label=/*bompnl_dcl_008*/"User function 3";
}

 

Change the text to whatever makes sense to you. For example,

 

:toggle{key="user3";
label=/*bompnl_dcl_008*/"Item Number Update";
}

 

If you ever need more than 3 options in the user post you can add more toggles for example,

 

:toggle{key="user1";
label=/*bompnl_dcl_006*/"QTY x SUBQTY x USER1 unit cost = USER2 total";
}
:toggle{key="user2";
label=/*bompnl_dcl_007*/"QTY x SUBQTY --> QTY, blank out SUBQTY";
}
:toggle{key="user3";
label=/*bompnl_dcl_008*/"User function 3";
}
:toggle{key="user4";
label=/*bompnl_dcl_009*/"User function 4";
}

 

The important part is the key value. It must be unique within the .dcl file. It is what links the button\check box to the code in the .lsp file that tells it what to do when you pick it. So if you added another check box in the .dcl you would just add the corresponding code in the .lsp file, using the existing code options as an example to add #4.

 

Hope this helps,

Pat

 

 



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

Autodesk, Inc.

Message 7 of 8

Pat,

 

Perfect, thanks! It's also good to know you can have more than 3 User Post routines.

 

 

Matthew Johnston
Sr. Controls Scientist
Corning Inc.
Message 8 of 8

Yes, I've seen some that have more than 10 options in a user post. It really extends the flexibility of the reporting function.

 

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