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

Dialogue box opens and disappears

12 REPLIES 12
Reply
Message 1 of 13
mattok
392 Views, 12 Replies

Dialogue box opens and disappears

HI. I have this LISP routine that was created for me a while ago. It has just now decided to stop working. Can anyone decipher an error in the attached?

 

I have a number of LISP routines for this task. About half of the routines now do not work.

Matt

12 REPLIES 12
Message 2 of 13
mattok
in reply to: mattok

To be a little more specific. This routine drops out at;

 

Command: (load "projectdata") LISTLAYERS

Command: projectdata ; error: bad argument type: stringp nil

 

Message 3 of 13
mattok
in reply to: mattok

Also, oddly enough, the routine works within a drawing we were working in last year.

It does not work in any new drawings.

A Saveas of the drawing that it works in also fails to provide a solution.

Message 4 of 13
pbejse
in reply to: mattok


@mattok wrote:

To be a little more specific. This routine drops out at;

 

Command: (load "projectdata") LISTLAYERS

Command: projectdata ; error: bad argument type: stringp nil

 


First of all, that error will appear if the "codelist.txt" is not found.

 

It would help the forum members to figure out the problem if you care enough to post ALL pertinent data to run the routine.

 

"codelist.txt"

"editproj.dcl"

 

and a sample drawing to go with that.

 

Message 5 of 13
mattok
in reply to: pbejse

Thanks a lot for your reply!

 

The file codelist.txt is at a path that it will find & also resides in the same directory as the LSP file.

 

Please excuse the messy drawing attached, it a base we need to build upon but without the dialogue box working I'm stuck.

 

All files attached here.

Matt.

 

Message 6 of 13
iwafb
in reply to: mattok

Everything seems to work at my end. Dialogue displays and all pulldowns enabled. You mentioned things just stopped working... Have you done any changes/updates before it stopped working?

 

I would check where your files are stored and make sure they reside in the Autocad search path as a start. As long as autocad can find the dcl, txt and lsp file then it should work...

 

Cheers,

John

Message 7 of 13
mattok
in reply to: iwafb

Thanks for checking John.

 

All the files are on a network. The file locations haven't changed & my PC has the same workspace settings & file paths as it did last year.

 

The only thing that has changed is a minor amendment to the list of servers that house our licenses. But if that was affecting me, I wouldn't even be able to get a license to open AutoCAD in the first place.

 

If it's working fine for you, can I send you my procedures & checklists and you can do the job for me? 🙂

Message 8 of 13
pbejse
in reply to: mattok


@mattok wrote:

Thanks a lot for your reply!

 

The file codelist.txt is at a path that it will find & also resides in the same directory as the LSP file.

 

Please excuse the messy drawing attached, it a base we need to build upon but without the dialogue box working I'm stuck.

 

All files attached here.

Matt.

 


I can see Dialog box on my end. Can you walk me thru your routine and tell me what exactly would happen if i press OK on the dialog box?

what are the values for input for 

 

Project Number

Design File

Section Number.

 

and what is the expected result?

 

 

Message 9 of 13
mattok
in reply to: pbejse

Any input into those fields would be fine. They are just alpha-numeric. reference numbers.

In this instance they would be

Project Number 13PD8846

Design file 01

Section number would be left blank

 

This part of our process simply records values into different variables in order to reference them again later with other routines.

The end result is a collection of text files with numbers reflecting different elements (eg 200=2014)

As the text files require those values many, many times, this routine saves us a lot of data entry later.

 

I'm sure that the values it records all store fine. It's just the dialogue not opening on our computers that baffles me.

 

 

Message 10 of 13
pbejse
in reply to: mattok


@mattok wrote:

 

It's just the dialogue not opening on our computers that baffles me. 

 


 

Simply put. the dialog file is not found

 

(setq projdl (load_dialog "editproj.dcl"));<--- error if not found

 

You can add  (setq projdl (load_dialog (findfile "editproj.dcl")))

 

And ensure that the file "location" is included on yur SFSP (Support File Search Path)

or

Hard code the location of the target file (findfile "Z:\\main\\path\\folder\\editproj.dcl");<---- 

 

You can make it fancy by adding a sub to determine the Netwrok drive letter and a cool findfile sub to go with that.

 

Message 11 of 13
iwafb
in reply to: mattok

Because the dialogue opens and then dissapears, I would bet it's not the dcl file location but the codelist.txt file location which is populating all the pulldowns in the dialogue.

 

Definitely check your file search paths (Autocad options) and make sure the file is located somewhere in that path. If you wanted a quick check, copy the codelist.txt file into the same folder where the drawing is located. If the dialogue works, then it's definitely the search path...

 

Cheers,

John

Message 12 of 13
pbejse
in reply to: iwafb


@iwafb wrote:

Because the dialogue opens and then dissapears, I would bet it's not the dcl file location but the codelist.txt file location which is populating all the pulldowns in the dialogue.

 

Definitely check your file search paths (Autocad options) and make sure the file is located somewhere in that path. If you wanted a quick check, copy the codelist.txt file into the same folder where the drawing is located. If the dialogue works, then it's definitely the search path...

 

Cheers,

John


I wasnt aware of the opens and then dissapear thing, guess i missed that. But I was meaning to say its one or the other.[dcl or txt]  At any rate "essential" files are not found hence the crash.

 

 

 

Message 13 of 13
mattok
in reply to: iwafb

I suspected the same. But all files are in the same location & the path is set correctly in my Support File Search Path.

 

Thanks pbejse & John for your input, any other ideas please let me know.

 

I will not be back in the office until Monday so I'll investigate further then, but given that this works elsewhere & not at work, there is something wrong with us. But I'm certain it's not the paths/file locations.

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

Post to forums  

Autodesk Design & Make Report

”Boost