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

AutoLISP to save user input for reuse

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
MrEngineer
2870 Views, 16 Replies

AutoLISP to save user input for reuse

Hi,

 

I've developed a LISP that asks the user for inputs such as distances in order to carry out offsets from a centreline. The code runs perfectly but requires the user to input a series of information each time he runs that command. What i would like is for the lisp to store the information so that the user won't have to re-enter it every time he carries out this command. Ideally, the user would be prompted, after he has input all his information, to give this information a name such as 'data1', which will be saved in a database, and the next time he runs this command he will be given the option to enter new information or use the 'data1' information.

 

Can someone help me with this?

 

Thanks

16 REPLIES 16
Message 2 of 17
3wood
in reply to: MrEngineer

The user can use Up and Down Arrow to stroll previous inputs. It is a built-in function, no need extra programing works.

Message 3 of 17
MrEngineer
in reply to: 3wood

Yes, but this is not ideal in this situation as the programme is quite long and scrolling up and down takes quite a while to get to the correct inputs.

 

It will only work effectively if the user can save a set of inputs under a specified name and reuse them later.

 

I have seen something like this in operation before but I don't know how the code for it would look.

 

Thanks

Message 4 of 17
pbejse
in reply to: MrEngineer


@MrEngineer wrote:

Yes, but this is not ideal in this situation as the programme is quite long and scrolling up and down takes quite a while to get to the correct inputs.

 

It will only work effectively if the user can save a set of inputs under a specified name and reuse them later.

 

I have seen something like this in operation before but I don't know how the code for it would look.

 

Thanks


Post your code here and we'll update it for you 

Message 5 of 17
MrEngineer
in reply to: pbejse

(defun c:UserInput		;establishes command name
		(/ SWRwidth TSERwidth FSRwidth SWLwidth TSELwidth FSLwidth SWRoffset TSERoffset FSRoffset SWLoffset TSELoffset FSLoffset cl p e)	;establishes the different variables.
 
;USER INPUTS START

;Establish North-east offsets and widths 
	(princ "\n FOR NORTH-EAST SIDE OF CORRIDOR")
	
	(setq SWRwidth  (getdist "\n Enter width of SW corridor on N-E side of centreline (if none, enter 0): "))
     (cond ((> SWRwidth 0)	
	(setq SWRoffset (getdist "\n Enter SW offset distance from centreline: ")))
        (t (princ "\n No SW on N-E side of centreline"))
     )						
	(setq FSRwidth   (getdist "\n Enter width of FS corridor on N-E side of centreline (if none, enter 0): "))
     (cond ((> FSRwidth 0)	
	(setq FSRoffset  (getdist "\n Enter FS offset distance from centreline: ")))
	(t (princ "\n No FS on N-E side of centreline"))	
     ) 					
	(setq TSERwidth  (getdist "\n Enter widht of TSE corridor on N-E side of centreline (if none, enter 0): "))
     (cond ((> TSERwidth 0)
	(setq TSERoffset (getdist "\n Enter TSE offset distance from centreline: ")))
	(t (princ "\n No TSE on N-E side of centreline"))	
     ) 

;Establish South-west offsets and widths
	(princ "\n FOR SOUTH-WEST SIDE OF CORRIDOR")

	(setq SWLwidth  (getdist "\n Enter width of SW corridor on S-W side of centreline (if none, enter 0): "))
     (cond ((> SWLwidth 0)	
	(setq SWLoffset (getdist "\n Enter SW offset distance from centreline: ")))
        (t (princ "\n No SW on S-W side of centreline"))
     )						
	(setq FSLwidth   (getdist "\n Enter widht of FS corridor on S-W side of centreline (if none, enter 0): "))
     (cond ((> FSLwidth 0)	
	(setq FSLoffset  (getdist "\n Enter FS offset distance from centreline: ")))
	(t (princ "\n No FS on S-W side of centreline"))	
     ) 					
	(setq TSELwidth  (getdist "\n Enter widht of TSE corridor on S-W side of centreline (if none, enter 0): "))
     (cond ((> TSELwidth 0)
	(setq TSELoffset (getdist "\n Enter TSE offset distance from centreline: ")))
	(t (princ "\n No TSE on S-W side of centreline"))	
     ) 

;USER INPUTS END

 Sorry if the formatting's bad, I'm a beginner at this. This section above is the input part of the LISP. There's more that follows relating to offsets but that's long and i think unrelevant to my question. But if you can see, the code is requesting 6 to 12 inputs off the user. Once these inputs have been made i want the user to be able to save them under a name such as 'data1' and then the next time he enters the command he can select whether to input new values or use 'data1'.

 

Hope that explains it.

 

Thanks

Message 6 of 17
pbejse
in reply to: MrEngineer


@MrEngineer wrote:

....The code is requesting 6 to 12 inputs off the user. Once these inputs have been made i want the user to be able to save them under a name such as 'data1' and then the next time he enters the command he can select whether to input new values or use 'data1'.

 

Hope that explains it.

 

Thanks


Here's the thing MrEngineer  if you need to remember the last entry on the "current" session, you can do away with the external file and use a "default" option per query. Here's a good link for that --->  Prompting with a Default Option  <-- courtesy of Lee Mac

 

Or are you wanting to use "the values" on another file? or the values are drawing "specific" , like next time you use the program, the latest and the greatest values set on the variables will be use on the current session?

Message 7 of 17
MrEngineer
in reply to: pbejse

I see what you mean by using Lee Mac's code but the aim of my lisp is to minimise the number of decisions to be made by the user (i.e as few clicks or 'enters' as possible'.

 

I'll explain what my code does. I have for example 30 corridors - 10x 10m corridors, 10x 20m corridors and 10x 30m corridors. My code automatically creates offsets from a selected centreline (these offsets represent utilities under that road). Each corrdior width has a different set of offsets (decided by the utility engineer). Using my current code, the user runs the command, inputs the various offset distances and widths (this is just for lineweight) as prompted, selects a centreline (for the correct corridor width 10m, 20m, or 30m) and the offsets are produced. I have a loop included so that he can run the same offsets on the next centreline if appropriate. BUT, if the user presses 'Escape' for any reason (which always happens) or makes a mistake the next time he runs the command he has to input the values again.

 

I hope I described that well.

 

So, what i want is that when the user inputs all the offset and width values, he/she can save them under a name such as '10m Corridor' and then the next time he runs that command he will get the option of inputting new values (for the 20m road for example) or re-using the '10m Corridor' values.

 

This will probably require loads of lines of code but I just don't even know where to start so any help at all would be appreciated. 

 

Sorry for the long message and thanks for the help.

Message 8 of 17
Kent1Cooper
in reply to: MrEngineer


@MrEngineer wrote:

.... 

I've developed a LISP that asks the user for inputs such as distances in order to carry out offsets from a centreline. The code runs perfectly but requires the user to input a series of information each time he runs that command. What i would like is for the lisp to store the information so that the user won't have to re-enter it every time he carries out this command. Ideally, the user would be prompted, after he has input all his information, to give this information a name such as 'data1', which will be saved in a database, and the next time he runs this command he will be given the option to enter new information or use the 'data1' information.

....


Here's a routine that you could use as an example.  It assumes default values at the first use [except for the Text content], reports what the current settings are, and the User can call for options to change any of those settings, and select something to do its thing on when all the settings are as they want.  Either Escape or Enter or Space will end it.  It remembers all the settings for subsequent use, reporting what they are and again giving the User options to change any of them.  Obviously its stored values are different from what you will need, but it should give you an idea of a way to go about it -- some of the types of information will be the same, e.g. numerical values and perhaps the Layer name.

Kent Cooper, AIA
Message 9 of 17
MrEngineer
in reply to: Kent1Cooper

Thanks for your help guys.

 

I came across this lisp from jeffery sanders http://www.jefferypsanders.com/autolisp_GetCells.html

 

I tweaked and changed it to suit my situation and now its working perfectly. basically what it does is extracts my required offset distances from an excel file (which can be easily modified by the utilities engineer) and implements those into the LISP routine and with just a few clicks it all works as desired!! 😄

 

 

Message 10 of 17
scot-65
in reply to: MrEngineer

You have to make a decision as to how to store your "Remember from last time" values.

 

  •   Is it for the current session only?
  •   Is it for the DWG file itself?
  •   Is it for all DWG files you access?
  •   Is it for you and all the other workstations?

 

Current session will have an initialization section and subsequent values can be saved as a "USER" variable for next use.

Just be sure not to declare this "USER" list in the defun section of your code. I call this guy the Gremlin.

 

Store the values in the DWG file itself by using VLAX-LDATA-PUT. Store as a LIST.

If VLAX-LDATA-GET does not return anything, then load defaults.

 

For all drawing files, and possibly permissions issue when trying to store in the registry, use SETCFG and GETCFG.

No external file will be required. This will work only on your workstation.

 

For all workstations to have access to the stored values, use an external file.

In all my years of program writing, I have not needed to use this method, or the previous one.

 

Bottom line is avoid writing to the registry or read/write from/to an external file where possible.

 

My guess from looking at your code is you want to store the values in the DWG file itself?


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 11 of 17
pbejse
in reply to: MrEngineer


@MrEngineer wrote:

Thanks for your help guys.

 

....I tweaked and changed it to suit my situation and now its working perfectly. basically what it does is extracts my required offset distances from an excel file (which can be easily modified by the utilities engineer) and implements those into the LISP routine and with just a few clicks it all works as desired!! 😄

 

 


I guess that approach would eliminate the multiple prompts, A'm also curious about same thing as Scot-65 though.

 

  •  Is it for the current session only?
  •   Is it for the DWG file itself?
  •   Is it for all DWG files you access?
  •   Is it for you and all the other workstations?

 

Message 12 of 17
MrEngineer
in reply to: pbejse

  • Is it for the current session only?
  •   Is it for the DWG file itself?
  •   Is it for all DWG files you access?
  •   Is it for you and all the other workstations?

 

Sorry, I'm not sure how to answer these questions. Basically, I open a single drawing file that contains road centrelines. I run the Lisp command which opens the spreadsheet and extracts the excel values which I've attached to variables within the lisp - all this happens 'behind the scenes'. Then it prompts me to select my required centreline, I do that, then select the correct sides of the centreline, and the offsets are produced all along that specific centreline. There is a loop included which allows me to keep selecting centrelines without having to re-run the command. Then when i press escape and want to run it again i have to enter the command and select the spreadsheet again. I might change this to avoid having to select the spreadsheet again but for now it works.

 

Hope this answers your questions. If you want i can share the code - as I really appreciate when people do that in their blogs.

 

Thanks

Message 13 of 17
pbejse
in reply to: MrEngineer


@MrEngineer wrote:

  •   Is it for the current session only?
  •   Is it for the DWG file itself?
  •   Is it for all DWG files you access?
  •   Is it for you and all the other workstations?

 

Sorry, I'm not sure how to answer these questions. 

 

Thanks


Thank you for indulging us MrEngineer, I think i understand now, The values would be dictated by the utility engineer using an external file, that way you are using the same value as the one shown on the excel file. [latest and greatest]. 

 

As for the questions above, disregard them, all that matters is the code you wrote works for you.


 

Hope this answers your questions. If you want i can share the code - as I really appreciate when people do that in their blogs.

 

Thanks


Indeed it has, No need to share MrEngineer, the routine is specific to your needs, I got the general idea though, But you can if you still want to. And if you do, just attached the lsip file instead of posting the code here.

 

Attachments

[Choose File]

 

Thank you for your time.

Message 14 of 17
MrEngineer
in reply to: pbejse

 That's my finished code for anyone who would like to use it. I'm sure there are bits and pieces of it that can be extracted and re-used for other purposes. Sorry if the formatting isn't great, but I'm not that experience yet. I've tried to navigate the user through with comments to help the process.

 

Enjoy



(defun C:WetUtilities(/  SWRwidth TSERwidth FSRwidth SWLwidth TSELwidth FSLwidth SWRoffset TSERoffset FSRoffset SWLoffset TSELoffset FSLoffset cl p e)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This part of the code extracts the excel values from the spreadsheet ;;;;;;;;;;; 
;It is brought into effect later on when 'getCellsFunction' is called into work ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


  (vl-load-com)
  (defun getCellsFunction(fileName sheetName cellName / myXL myBook mySheet myRange cellValue)
    (setq myXL(vlax-get-or-create-object "Excel.Application"))
    (vla-put-visible myXL :vlax-false)
    (vlax-put-property myXL 'DisplayAlerts :vlax-false)
    (setq myBook (vl-catch-all-apply 'vla-open (list (vlax-get-property myXL "WorkBooks") fileName)))
    (setq mySheet (vl-catch-all-apply 'vlax-get-property (list (vlax-get-property myBook "Sheets") "Item" sheetName)))
    (vlax-invoke-method mySheet "Activate")
    (setq myRange (vlax-get-property (vlax-get-property mySheet 'Cells) "Range" cellName))       
    (setq cellValue(vlax-variant-value (vlax-get-property myRange 'Value2)))
    (vl-catch-all-apply 'vlax-invoke-method (list myBook "Close"))
    (vl-catch-all-apply 'vlax-invoke-method (list myXL "Quit"))
    (if (not (vlax-object-released-p myRange))(progn(vlax-release-object myRange)(setq myRange nil)))
    (if (not (vlax-object-released-p mySheet))(progn(vlax-release-object mySheet)(setq mySheet nil)))
    (if (not (vlax-object-released-p myBook))(progn(vlax-release-object myBook)(setq myBook nil)))
    (if (not (vlax-object-released-p myXL))(progn(vlax-release-object myXL)(setq myXL nil)))    
    (if(= 'safearray (type cellValue))
      (progn
        (setq tempCellValue(vlax-safearray->list cellValue))
        (setq cellValue(list))
        (if(= (length tempCellValue) 1)
          (progn
            (foreach a tempCellValue
              (if(= (type a) 'LIST)
                (progn
                  (foreach b a
                    (if(= (type b) 'LIST)
                      (setq cellValue(append cellValue (list (vlax-variant-value (car b)))))
                      (setq cellValue(append cellValue (list (vlax-variant-value b))))
                    )
                  )
                )
                (setq cellValue(append cellValue (list (vlax-variant-value a))))
              )
            )
          )
          (progn
            (foreach a tempCellValue
              (setq tmpList(list))
              (foreach b a
                (setq tmp(vlax-variant-value b))
                (setq tmpList(append tmpList (list tmp)))
              )
              (setq cellValue(append cellValue tmpList))
            )
          )
        )
       (atof "cellValue") 
      )
    )
    cellValue
  )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This part of the code is where the user interface begins ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;The programme prompts the user to select a file. This will be the input spreadsheet ;
;The code automatically selects the correct tab of the spreadsheet ;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


  ;;;--- Get the excel file
  (setq fileName(getfiled "Select Excel File" "" "*" 16))

  ;;;--- Get the sheet name
  (setq sheetName "INPUT TABLE")


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;The relevant cells are extracted ;;;;;;;;;;;;;;;;;;;;;;;;;;
;The getCellsFunction above is run ;;;;;;;;;;;;;;;;;;;;;;;;;
;The cellvalue is attached to the specific utility ;;;;;;;;;
;The cellvalue is printed to the command box for reference ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(print (strcat "The following offsets and widths have been extracted from the selected excel file:"))
  
(/= "" (setq cellName "C4"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq SWLwidth cellValue)

    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of SWLwidth is: "))(princ cellValue)

(/= "" (setq cellName "C5"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq SWLoffset cellValue)

    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of SWLoffset is: "))(princ cellValue)

(/= "" (setq cellName "C6"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq FSLwidth cellValue)


    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of FSLwidth is: "))(princ cellValue)

(/= "" (setq cellName "C7"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq FSLoffset cellValue)	

    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of FSLoffset is: "))(princ cellValue)

(/= "" (setq cellName "C8"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq TSELwidth cellValue)	

    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of TSELwidth is: "))(princ cellValue)

(/= "" (setq cellName "C9"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq TSELoffset cellValue)	

    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of TSELoffset is: "))(princ cellValue)


(/= "" (setq cellName "C11"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq SWRwidth cellValue)
	

    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of SWRwidth is: "))(princ cellValue)

(/= "" (setq cellName "C12"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq SWRoffset cellValue)


    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of SWRoffset is: "))(princ cellValue)

(/= "" (setq cellName "C13"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq FSRwidth cellValue)


    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of FSRwidth is: "))(princ cellValue)

(/= "" (setq cellName "C14"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq FSRoffset cellValue)


    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of FSRoffset is: "))(princ cellValue)

(/= "" (setq cellName "C15"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq TSERwidth cellValue)


    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of TSERwidth is: "))(princ cellValue)

(/= "" (setq cellName "C16"))

    	;;;--- Get the value of the cell or cells
   	 (setq cellValue(getCellsFunction fileName sheetName cellName))
	 (setq TSERoffset cellValue)


    	;;;--- Display the value of the cell(s)
    	(princ (strcat "\n The value of TSERoffset is: "))(princ cellValue)
	  
  (princ)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This is where the user is prompted to carry out the offsets ;;;;;;;;;;;;;;;;;;;
;A centre-line is selected                                   ;;;;;;;;;;;;;;;;;;;
;And then, as per Technical Memo #1, the side of the offset is selected ;;;;;;;;
;The corridors are painted and the user is prompted to select a new centreline ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(while

(princ "\n Select a corridor centreline to offset.") 				;this prompt will appear in the command box
  
   (and
    (setq cl (ssget "_+.:S:L" '((0 . "*POLYLINE,*LINE,CIRCLE,ELLIPSE"))))	;Select centreline (which from now on will be referred to as 'cl')
    (setq p (getpoint "\n Specify point to the North - East:"))			;this will prompt user to select side on which to offset
   )

   (progn
       
     (cond ((> SWRwidth 0) 
	(command "_.offset" SWRoffset cl "_non" p "")  			;Line is offset SWRoffset from ss (centreline)
       	(setq e (entlast))						;Sets this new line as 'e'
       	 (if (tblsearch "LAYER" "SW")					;Finds the SW layer in the Layer table
          (command "_.chprop" e "" "_layer" "SW" ""))			;Changes properties of 'e' to SW
         (if (tblsearch "LAYER" "SW")			
          (command "_.pedit" e "_W" SWRwidth "")))			;Edits the width of e to SWRwidth
   	(t (princ "\n NO SW"))
     ) ;cond

     (cond ((> FSRwidth 0)
	(command "_.offset" FSRoffset cl "_non" p "")
       (setq e (entlast))
       (if (tblsearch "LAYER" "FS")
         (command "_.chprop" e "" "_layer" "FS" ""))
       (if (tblsearch "LAYER" "FS")
         (command "_.pedit" e "_W" FSRwidth "")))
   	(t (princ "\n NO FS"))
     ) ;cond

    (cond ((> TSERwidth 0)
	(command "_.offset" TSERoffset cl "_non" p "")		
       (setq e (entlast))
       (if (tblsearch "LAYER" "TSE")
         (command "_.chprop" e "" "_layer" "TSE" ""))
       (if (tblsearch "LAYER" "TSE")
         (command "_.pedit" e "_W" TSERwidth "")))
   	(t (princ "\n NO TSE"))
     ) ;cond

       (and
        (setq p (getpoint "\n Specify point to the South - West:"))
       )
 
     (cond ((> SWLwidth 0)
	 (command "_.offset" SWLoffset cl "_non" p "")  		
       	(setq e (entlast))						
       	 (if (tblsearch "LAYER" "SW")					
          (command "_.chprop" e "" "_layer" "SW" ""))			
         (if (tblsearch "LAYER" "SW")				
          (command "_.pedit" e "_W" SWLwidth "")))
	(t (princ "\n NO SW"))
     ) ;cond	
 
     (cond ((> FSLwidth 0)
	(command "_.offset" FSLoffset cl "_non" p "")
       (setq e (entlast))
       (if (tblsearch "LAYER" "FS")
         (command "_.chprop" e "" "_layer" "FS" ""))
       (if (tblsearch "LAYER" "FS")
         (command "_.pedit" e "_W" FSLwidth "")))
   	(t (princ "\n NO FS"))
     ) ;cond

    (cond ((> TSELwidth 0)
	(command "_.offset" TSELoffset cl "_non" p "")		
       (setq e (entlast))
       (if (tblsearch "LAYER" "TSE")
         (command "_.chprop" e "" "_layer" "TSE" ""))
       (if (tblsearch "LAYER" "TSE")
         (command "_.pedit" e "_W" TSELwidth "")))
   	(t (princ "\n NO TSE"))
     ) ;cond
      
  )  ;progn
  
) ;while
) ;defun

 

Message 15 of 17
ksh.jin
in reply to: MrEngineer

Hey!

 

I am trying to do something similar and found your code on the forum. I tried to load your code as it is and it straight away asked for an excel sheet (which I didn't have). I then saved a blank excel sheet and loaded the code again. This time I selected the blank excel sheet but it showed an error as it couldn't load any values I guess. Can you help me please?

 

 

Message 16 of 17
Kent1Cooper
in reply to: ksh.jin


@ksh.jin wrote:

.. it straight away asked for an excel sheet (which I didn't have). I then saved a blank excel sheet and loaded the code again. This time I selected the blank excel sheet but it showed an error as it couldn't load any values .... 


The code requires an already-existing spreadsheet file with data already in it, which the code applies to drawing operations.  What exactly are you trying to do that would not  make use of a file like that?  Describe what steps you want the User to take, where information would come from, etc.

Kent Cooper, AIA
Message 17 of 17
ksh.jin
in reply to: Kent1Cooper

Hey Kent,

 

Ya sure. I want user input to draw, say rectangles and will ask for file name in the beginning. Later I want to save the input data in some way, say excel sheet or dxf, with the file name given by the user. Later when the user loads the program and enters the same file name, all the earlier inputs must be set as a default value for the parameters so that the user can change the values for the parameters he wants to instead of filling all the values again.

 

Thanks!

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

Post to forums  

Autodesk Design & Make Report

”Boost