Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fail to Use LISP to Use a Third Party Software to Select Objects

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
JC_BL
570 Views, 5 Replies

Fail to Use LISP to Use a Third Party Software to Select Objects

I have a problem in using a LISP program to use a tool from a third party software.  I would like to know if there is a way around the problem.

 

We use a third party software in AutoCAD to draw objects on AutoCAD drawing (HVAC duct work).  Because the objects are stored in the drawing in the format that only the third party software can understand, we rely on using the tools from the third party software to operate on their objects.  That third party software is designed for many customers, and we are just one of their customer.  Therefore, we cannot expect the third party software to have everything that we want.  We want to develop a LISP program to automate our process to meet our specific needs.  That LISP program will need to use the tools from the third party software in order to operate on their objects.  And that is where the problem starts.

 

Let me explain what I am trying to do.  We have a piece of duct that has a duct body and a piece number tag.  I have the entity handle of the duct body in our database.  And I can use it to select the duct body using plain LISP program.  But I don't know a way to select the piece number tag that is corresponding to the duct body.  I have examined the properties of the duct using (entget (car (entsel))).  But I cannot find an obvious way to link from the duct body to the piece number tag.  This means I have to use a selection-tool from the third party software to select the piece number tag of the duct that I have selected using LISP.  Unfortunately, I find that the third party selection-tool doesn't seem to work if I call it right in the middle of a LISP program.  On the other hand, it works if I use it manually (outside LISP) or if it is used right before the LISP program is terminated.  I don't understand why it doesn't work in the middle of a LISP program.  I asked the developer of the third party software, and he said that this could not be done without rewriting the entire software.  This means I need to find a way to get around this problem (if there is any solution at all).

 

By the way, I call that third party selectin-tool by either manually clicking at a button or using a C# program to simulate a mouse click at the button.  Either way, the result is the same.

 

Please let me know if you have any suggestion.  Thanks in advance.

 

Jay Chan

5 REPLIES 5
Message 2 of 6
stevor
in reply to: JC_BL

Your routes are to either 1. hire someone to listen to your requirements and make the s/w, which can likely end up as more 3rd party ware; 2. learn enough lisp to do it yourself: that is the purpose of autolisp, probably the cause of the Autocad sucess. There is lots of open autolisp code for ductwork available, ie, not compiled
S
Message 3 of 6
hgasty1001
in reply to: JC_BL

Hi,

 

Can you post a sample, and simple dwg with "third party" objects, and a description in the dwg of your requirements?. What you are describing in the post looks like custom entities, if  so, you are restricted to the object enabler exposed capabilities.

 

Gaston Nunez

 

 

Message 4 of 6
JC_BL
in reply to: JC_BL

No, we are not going to change the ducting software just because we cannot use LISP to interact with the duct objects on the drawing.  This would be too big an undertaking for us.  We have invested years of time and money in it.

 

If this cannot be done, we will have to find a different way to handle this.

 

Thanks for responding to my question though.

 

Jay Chan

Message 5 of 6
JC_BL
in reply to: hgasty1001

Attached please find a sample drawing that has 3 pieces of duct on it. You can see from the sample drawing that the duct body (the outline of the duct) has most of the properties about the duct. It also has a piece number tag. I am trying to be able to select the duct body using LISP, and then automatically / programmatically select the corresponding piece number tag. And I want to be able to do the reverse (select the piece number tag first, and then automatically / progammatically select the corresponding duct body). Can this be done?

 

I am still very puzzled of the fact that I can do this if I call the third party selection tool as the very last step of the LISP program. But I cannot do this if it is called in the middle of the LISP program.

 

Thanks in advance for anything that you can help.

 

Jay Chan

Message 6 of 6
JC_BL
in reply to: JC_BL

I finally have this problem fixed.  The third party software developer changed his mind and found a way to provide me a way to call the third party selection tool directly through standard LISP (command).  More importantly, this new command also fixes the problem of failure of selecting objects using the third party selection tool if it is called from the middle of a LISP program.

 

I don't know how they fixed the problem.  But I am glad that this is fixed.

 

Thanks for people here who have tried to help me.

 

Jay Chan

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

Post to forums  

Autodesk Design & Make Report

”Boost