|
R.K. McSwain | CAD Panacea |
Yes, I could specify "NUM" variable completely during user input however the problem is it's too much for the user to input...this is what I mean:
For example:
J:/123/4567/Datum_Grid/1234567_DATUM.dwg
Here it's easy the user just enters "1234567" and later breaks it up into two variables
But when there is text to follow the job number it's too much for the user to enter:
J:/123/4567 - Education and Support Center/Datum_Grid/1234567_DATUM.dwg
Here the user would have to enter "4567 - Education and Support Center"
Is there a function of some sort where I could retrieve the text that follows after the number by just specifying the drive "J:/123/4567"
Or any other ideas?
Please check it
inserting-blocks-from-folder - Standard.zip
Last edited by devitg.89838; 2013-03-27 at 05:02 PM. Reason: cosmetic
I think this would work for you, I tried it on a similar file structure and it seemed to work ok.
You may need to add another folder in the structure, I think you have a "Datum_Grid" folder??
From what I'm reading, you have a file structure where you want the user to type a first set of numbers for the first part of a project number and then type a second set of numbers which is another part of the project number, and you have a constant "project name" (suffix) and a block name that uses the first two typed numbers and a constant suffix.
Taken from RK's starter code..
Hope this helps.Code:(defun c:test (/ begin inter num projname blk) (setq begin "J:\\") ;;your drive letter (setq inter (getstring (prompt "First Numbers??"))) ;;your first project numbers XXX (setq num (getstring (prompt "Second Numbers??"))) ;;your second project numbers XXXX (setq projname " - Education and Support Center") ;;your constant project name (suffix) (setq blk "_datum") ;;your constant block name (suffix) (setq fullpath (strcat begin inter "\\" num projname "\\" inter num blk)) ;;sets the whole path from info given above (command "-insert" fullpath "" "" "");;edit according to how you want to handle your insert options )
Ted,
Sorry for my confusing writing...unfortunately the "suffix" is not a constant
ex.1 123/4567-Education and Support Center
ex.2 222/3333-High Rise Construction Building
ex.3 333/4444-Childrens Hospital
Ex.1 "suffix" = Education and Support Center
Ex.2 "suffix" = High Rise Construction Building
Ex.3 "suffix" = Childrens Hospital
I am fine with asking the user to enter 123/4567 or 222/3333 or 333/4444 because I can combine this into a string (like Ted mentioned)
but when I have to ask the user to enter the "suffix" then this code loses it's value because of a lot of typing on the user side.
If anyone has any other suggestions on how I can achieve this task please share.
Are the number prefixes part of a job or project number? Will there ever be more than one suffix for one set of prefixes?
Ex.1 123/4567-Education and Support Center
Ex.2 123/4567-High Rise Construction Building
Ex.3 123/4567-Childrens Hospital
If this will not happen, you could get a list of folders from a known location. You could then filter out that list by the secondary prefix. Being it would be a parent - child folder structure, it shouldn't be too difficult.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
Thank you, that is precisely what I would like to do.
That is correct there will only be one suffix for one set of prefixes...ex 123/4567 is only going to be Education and Support Center.
How do I access a directory to get a list of folders?
In the above example I would have to get into directory 123 then there would be a list of jobs where 4567-Education and Support Center would be one of them.
How do you envision this routine to operate? Do you want to request a project number combination? Or have the user browse for the necessary folder?
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt