Jump to content

Anyone care to offer comments on this routine?


Bhull1985

Recommended Posts

Hey all, I've finally reached a suitable stopping point for the valve list cad-to-excel program that I believe is a good place to ask for comments.

 

I'm going to ATTEMPT to attach the relevant files so that anyone can test the routine as-is, and then take a look at the code and offer me any comments to make more effecient or work better, etc!

 

IF you would like to iterate this program over your own selection of blocks then scroll down to the portion of code that has

 

FORMATTING is best when you MAXIMIZE window that the code is in.

 

Without further adue....remember to

Enjoy, comment, and thanks!

 

 

GETEXCEL-VALVES.LSP

getexcel.dcl

OGGP2-P01-2016.dwg

Valve List.xlsx

Link to comment
Share on other sites

An item I believe I need to work on, is properly releasing excel and it's children objects. I've a few calls to (gc) and (vlax-release..) but if someone more familiar knows how I should do it properly, please inform me!

Thanks

Link to comment
Share on other sites

Did you take a look, guys? :)

 

Why is the spreadsheet file marked "read only", for the moment, unless I figure out how to use it, it is preventing me from further getting the lisp to execute. ?????

Link to comment
Share on other sites

The second upload of the Excel file was also "read only". After saving to another location and file name, and deleting the first copies I was able to successfully get the program to work ok (I think !!). At first glance, this is a super lisp ! !. I could never get my blocks swept off to Excel, but no problem to a text file.

If there is ever a need to work on more than one valve or process "scheme" would you prefer to sweep each to a different xls sheet in the same file or sweep to individual xls files ?? I always swept to the same text file separated by *************** lines etc. Your blocks contain much more info than I ever considered, but my conduit layouts contained blocks for bends and other fittings complete with sizes. Going directly to spreadsheet is a great advantage vs. text files. Good job there.

FYI, program took longer to load than to dump dwg info to Excel.

Still wonder why the posted version of the xls was "read-only" all the time.

regards Steve

Link to comment
Share on other sites

Hi Steve, thanks for taking a look.

I am not sure what you mean by

If there is ever a need to work on more than one valve or process "scheme" would you prefer to sweep each to a different xls sheet in the same file or sweep to individual xls files ??

 

 

The program works on any blocks and any tags within those blocks as designated by the portions of code that have "

Additionally, and usually the only blank excel sheet is the first run, the append option is there for creating a longer list from different drawings, but using the same excel file so that it's a "running total"

 

What I would really like is for the program to have vector images of these valves in case we get drawings that have EXPLODED valve blocks in them- sometimes the clients sends the P&IDs with exploded valves and it is a headache.

 

 

If we could draw vector images of the valves and tell the code the layer that the line/pline representation of valves are on- and also that there would be text really close to these exploded linework valves....that would be of great value to me and my company and this program.

 

 

So valuable in fact I think I will start doing some research on vectors because this would be the next step to add to this program and I would direly wish for some guru who has vector experience to let me know if this would at all be possible.

 

 

Indeed, today I will create a post or two or three on the various autolisp boards to see if I can accurately describe a method to have this program work on valves that are exploded or not. I understand that these codes would only apply to the blocks that I am using currently but they are standard enough that it would be worthwhile, and understanding the process would allow for new vector images if ever needed for other blocks/tags.

 

 

Cheers, and I am glad to hear that the program worked for you.

Hopefully after you load it a few times it will be as quick to load for you as it is for me. Do you happen to see what would be causing it to load slowly?

I am looking for any tips or comments one may have on this program, so thanks a lot for what you've already put in!

Link to comment
Share on other sites

icon1.gif

 

Hi Steve, thanks for taking a look.

I am not sure what you mean by

If there is ever a need to work on more than one valve or process "scheme" would you prefer to sweep each to a different xls sheet in the same file or sweep to individual xls files ??

 

re: above

My question was... to clarify... if you had more than one idea on how to solve the piping problem, which probably resulted in more than one drawing of the same general layout, would you want to place the result of the valve takeoff on its own spreadsheet or place it into another "sheet" of the one and only spreadsheet.

I would probably prefer to have an additional "scheme" result in the same spreadsheet in another "sheet" tab so I could flip back and forth quickly to see where a possible avantage/disadvantage might be for material availability or cost savings etc. In my case if I were designing ten miles of watermain, then it is necessary to have a lot more than one drawing, to which each drawing quantity would be dumped to its unique "sheet" all within one spreadsheet. Then comes the trick on how to total all the "sheet" quantities to get grand total of individual items necessary to complete the project (or for bidding). Hope you get the "drift".

 

Link to comment
Share on other sites

I understand what you're saying but those needs are different from my needs and as such the code is appropriate for one, not the other.

Shouldn't be too difficult to accomplish what you've stated there- however method you'd like to do it.

For running totals you'd simply store the quantities in variables within the code and then recall them at the end of the routine. May have to add another DCL tile for "Last Sheet" if you'd want to do it this way.

For different sheets, you'd use one of the functions at the beginning of the routine I believe there was one for new excel sheets.

 

 

Our "schemes" are more like diagrams and as such there'd only be one layout with the same information, each layout would contain a different part of the plant's processes, typically.

Link to comment
Share on other sites

Does anyone have any insights into the vector aspects, to clarify here, is it possible to store vector representations of the blocks being used in order to combine with a layer name and have the program automatically determine EVEN IF A VALVE (BLOCK OBJECT) IS EXPLODED, that it needs to pull the text attribute information into it's "vallist"?

Link to comment
Share on other sites

hi Brandon, thank for your hand work coding & valve specifications rich info :)

1. i'm not sure is it a bug: when select radio button *ALL*Blocks, the [Pick_blocks] was purposely mode_tile to 0? unable to resume picking.

2. if valve blocks with masked or "wipeout", simply insert it without trimming the lines can be easier job?

3. i will loop to prevent invalid user input especially numbers in dialog just like initget does

(setq dd (Dialog))
(while
(not(vl-every ''((x)(and (numberp (read x))(not(minusp (read x))))) [color="red"] *user_input_list*[/color]))
(if (= dd 0)  (exit))
(setq dd (Dialog)))
(if (= dd 1)
.... next
)

 

4. i still have no idea if attributes exploded to retain value. or try the shape it can't be exploded also with vector, this example was generated by acet maybe can come up some ideas? or store as data?

*1,90,VALVES
4,250,4,4,3,31,3,143,3,77,002,9,(0,0),001,9,(-26,-43),(52,0),(-26,43),(0,0),002,9,(-43,-26),(0,0),001,9,(0,52),(86,-52)
(0,52),(-86,-52),(0,0),002,9,(16,58),(0,0),001,9,(54,0),(0,53),(-54,0),(0,-53),(0,0),002,9,(27,-32),(0,0),001,9,(0,32)
(0,0),002,9,(0,-32),(0,0),001,4,77,4,143,4,31,3,4,3,250,0

5. If the the valve specification list can be imported / exported to suit to local standards would be more user friendly? ie: support other language users

 

just my 2 cents , thank you :)

Link to comment
Share on other sites

Darn, I had thought you meant that was a solution to using vector imaging to locate exploded valves and extract their text/attribute information.

Link to comment
Share on other sites

hi Brandon, thank for your hand work coding & valve specifications rich info :)

1. i'm not sure is it a bug: when select radio button *ALL*Blocks, the [Pick_blocks] was purposely mode_tile to 0? unable to resume picking.

2. if valve blocks with masked or "wipeout", simply insert it without trimming the lines can be easier job?

3. i will loop to prevent invalid user input especially numbers in dialog just like initget does

(setq dd (Dialog))
(while
(not(vl-every ''((x)(and (numberp (read x))(not(minusp (read x))))) [color="red"] *user_input_list*[/color]))
(if (= dd 0)  (exit))
(setq dd (Dialog)))
(if (= dd 1)
.... next
)

 

4. i still have no idea if attributes exploded to retain value. or try the shape it can't be exploded also with vector, this example was generated by acet maybe can come up some ideas? or store as data?

*1,90,VALVES
4,250,4,4,3,31,3,143,3,77,002,9,(0,0),001,9,(-26,-43),(52,0),(-26,43),(0,0),002,9,(-43,-26),(0,0),001,9,(0,52),(86,-52)
(0,52),(-86,-52),(0,0),002,9,(16,58),(0,0),001,9,(54,0),(0,53),(-54,0),(0,-53),(0,0),002,9,(27,-32),(0,0),001,9,(0,32)
(0,0),002,9,(0,-32),(0,0),001,4,77,4,143,4,31,3,4,3,250,0

5. If the the valve specification list can be imported / exported to suit to local standards would be more user friendly? ie: support other language users

 

just my 2 cents , thank you :)

 

 

 

Thanks for your input hanhphuc! Let me reply to some of your concerns while I have a moment here.

1) Yes, this version of the program was designed for a specific set of blocks so I forewent coding the pick blocks subfunction. The outline is there and with some light modification this portion of the routine would be operational.

2) I'm not sure why you think valve insertion is part of this program- it's not. I use another routine that uses the break command to trim out plines behind valves, but that is irrelevant to this code. What's more relevant is accounting for exploded valves.

3) Thank you for this loop construction, when some more time frees I would definitely switch the code to contain a loop for the DCL controls, I will have a good time experimenting with your code there, thanks again.

4) thanks for the example, vectors are a hefty learning load so I'll have to tackle them when some free time arises--working 6 days a week and staying very busy. But some time will open soon enough and I hope to get the go ahead to spend more time on this program, if I do then vector images is where I would start.

5) I have a version that operates off of an external file that may be more suited to your needs (with another language). I'd have to contact the author in order to post it here, though.

 

 

 

 

Thanks for the very constructive comments, I will definitely return to them once some time opens!

Link to comment
Share on other sites

2) I'm not sure why you think valve insertion is part of this program- it's not. I use another routine that uses the break command to trim out plines behind valves, but that is irrelevant to this code. What's more relevant is accounting for exploded valves.

sorry Brandon i do think so, just disregard it :)

 

we will support you as put so much afford to make it perfect, keep coding^^

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...