본문 바로가기

카테고리 없음

Vlax-import-type-library (autolisp/activex Autocad For Mac

Vlax-import-type-library (autolisp/activex Autocad For Mac

G'day Tvdesign, I will cut you a deal. If you help me I will help you:) I to have been reading all three of Bill's tutorials, But when I go to load this from the visual lisp window it doesn't do anything. What do I have to do to get it to open up Excel??? I enclosed the file below. Tvdesign you have to import the type library. Which is the lines of code that I have put a (.) next to.

  1. Vlax-import-type-library (autolisp/activex Autocad For Mac
  1. If you are planning to upgrade to AutoCAD 2012 for Mac (or AutoCAD 2012 on Windows) and use AutoLISP, there is some exciting news. One of the best features of the new release is the ability to access and modify object properties with a set of 4 new functions.
  2. Retrieves the top-level AutoCAD application object for the current AutoCAD session (vlax-get-object “prog-id”) Returns a running instance of an ActiveX object (vlax-get-or-create-object “prog-id”) Returns a running instance of an ActiveX object, if one exists, otherwise starts a new instance of the object (vlax-import-type-library.

You can then come back into the visual lisp editor opp click anywhere on the lisp file and select Apropos Window type in XLP- then select match by prefix. Hello Borgunit, G'day Mike, OK, I had a look at lesson 3 and I'm still pretty confused.

Free AutoLISP and Visual LISP code snippets for AutoCAD. Using AutoLISP; axInsert.lsp Example of inserting a block with ActiveX in. If you look for an app that can load AutoLISP files from your library take a look at our app JTB Lisp. (vla-get-activedocument (vlax-get-acad-object)))) (if (> (vla-get-count layouts) 2).

First I'll try to answer your question. Are you 'running' the program with a line similar to this from the command line in acad? (link2excel 'c: lisp book1.xls') That should run the program and open up the file in excel. That's what I'm doing and although Excel does not show up on the taskbar, it must be opening my file because I cannot save a file 'over' the top of my book1.xls file in my lisp folder until I do this line: (xl-close myXLWb1) Anybody know if I should see excel on my taskbar at this point? I also had to edit the following line::tlb-filename 'C:/Program Files/Microsoft Office/Office/Excel8.olb' And I replaced it with this line::tlb-filename 'C:/Program Files/Microsoft Office/Office10/XL5EN32.olb' Because I'm running Office XP I guess the path and the.olb file are different Now I have a question for you.

I used the Apropos window and found nothing for xlp- using prefix or any other method. When I look for just xl- I get over 400 results and XL-GET-ITEM is one that shows in the window.

But it's nil. Are you 'stepping' through your code in vlisp?

When I do and I hit this line: myXLSh1 (xl-get-item myXLShs 'Sheet1');worksheet number 1 I get:; error: no function definition: XL-GET-ITEM Do you get the same results? What do you think? Thanks for your input! Kirk RE: Interfacing Excel with VLISP (Structural) 3 Feb 03 23:43. Top Stuff Kirk, (link2excel 'c: lisp book1.xls') Thats a dream. Add this line to see Excel on your taskbar.

It flashes up then parks itself again. (vlax-put-property xl 'Visible' T) put this line below this line (vlax-get-or-create-object 'Excel.Application') If you are getting no XLP- in the Apropos window then the type library isn't loading. Copy and paste the following to VLISP Editor then run. It doesn't do anything to the drawing environment.

Vlax-import-type-library (autolisp/activex Autocad For Mac

Then once again opposite click etc. (if (null xl-open);;Check to see if type library defined;;It is not, import the type library for EXCEL8 (vlax-import-type-library:tlb-filename 'C:/Program Files/Microsoft Office/Office/Excel8.olb';change this line for XP:methods-prefix 'xL-':properties-prefix 'xLp-':constants-prefix 'xLc-')):Are you 'stepping' through your code in vlisp?:When I do and I hit this line::myXLSh1 (xl-get-item myXLShs 'Sheet1');worksheet number 1:I get:; error: no function definition: XL-GET-ITEM:Do you get the same results? Kirk I am having major problems around this area also. I am getting a problem with an ActiveX Server and something about an RPC Server also. Will keep you posted. Cheers Mike RE: Interfacing Excel with VLISP (Computer). Hello again, OK, now I'm starting to get somewhere with this!

I really like the (vlax-put-property xl 'Visible' T) that you can use to make Excel visible on the taskbar. First of all I discovered why I was having problems with: xlp-Put-Value xlp-get-item xlp-get-value xlp-get-range This may have been common knowlege to VB programmers, but as a LISP guy I had some trouble here. Office XP (Excel 2002) uses the executable file itself, as the object library instead of a separate TLB or OLB file as was the case in older versions. In my code which is pasted in below I added a function: 'DSX-TypeLib-Excel' which does the following to make the program more friendly with different versions of Excel.

I got it off a website that has lots of info that may be helpful. Check it out!!!

Looks in several 'typical' installation folders and attempts to find the excel installation path to the.olb (object library) 2. Set variable excelver so I can use the proper Excel functions throughout the program.

Xl-get-item is a version 8 function whereas xlp-get-item is version 9 and above) I believe this is correct, although it has not been tested.Mike maybe this is a clue to your trouble with ActiveX Server and RPC Server. Not sure, just a thought. For now here is my code. I do beleive that from here on in I will be able to get this link with Excel figured out.

Any info I discover will be posted here. I've added a few 'if's' to help trap some errors. Give 'er a go mate and you'll see what I did! Thanks very much to Mike And Borg for all your help! This is cool stuff! Good luck and let me know how it goes.

(sans spanish spell check) Kirk;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Point A;; A scroll from the Wizard's Lab.;;;; Bill Kramer 2002;;;; Interface with Excel Worksheet;;;; Global Variables;; xL - Object reference to EXCEL instance;; myXLWbs - Object reference to EXCEL work books;; myXLWb1 - Object reference to Work book #1;; myXLShs - Object reference to Sheets in Work book;; myXLSh1 - Object reference to Sheet 1;; myXLNms - Object reference to list of named cells;; (prompt ' nLoading VLAX functions. Please Wait: ') (vl-load-com);;;-;; Open link to EXCEL spreadsheet, use existing;; instance of EXCEL if one exists otherwise;; load EXCEL and then open the file supplied;; as the variable xLFile.;;;;;;Add this line to see Excel on your taskbar. It flashes up then parks itself again.;;(vlax-put-property xl 'Visible' T);;put this line below this line;;(vlax-get-or-create-object 'Excel.Application') (defun Link2Excel (xLFile);Attempt to open existing or create new Excel instance (setq xL (vlax-get-or-create-object 'Excel.Application')) (vlax-put-property xl 'Visible' T);make Excel visible on the taskbar (if xL;;success? (progn (if (and xLFile (findfile xLFile));;Was a file name supplied? I have the code putting the data from a list into Excel. I also have the code to get the data from Excel and put it into a list.

Let me know if I can help you on any of these items. The two problems I am having are: 1. A dialog box appears whenever I attempt to save the Excel file. 'File already exist. Are you sure you want to overwrite?'

Vlax-import-type-library (autolisp/activex Autocad For Mac

I would really like to get rid of that box! I have a user that receives an error trying to get the data from excel using my code. His Excel object libraries are the same as mine. Same directory. Same version. He recieves the error: -Start of error messages- Last number generated was - 9 Last number generated was - 10 Last number generated was - 11 You are using Excel Version:9; error: Automation Error. Description was not provided.End of error messages- The code I use is basically the same as Kramer's with a few modifications including the ones stated above.

Hi Jeff, Don't know if you have figured out how to get around the overwrite existing file problem. One thing you may want to try is to save the file as a new file name. I have not tried this but think it's worth a shot. I was working on this code the other night and hit a stumbling block. Like the error your user described.; error: Automation Error. Description was not provided. I tried some code I found on another site and get the same errors.

Looks like from your post that you've figured out how to get this to work properly. I'd be interested in looking at your code and giving it a try with office xp to see if I can get past this error. If you'd be kind enough to post your code, that would be great. Thanks, Kirk RE: Interfacing Excel with VLISP (Structural) 4 Mar 03 03:13.

I have a Lisp program which draw objects acc. To different standards (self made). The user indicates the parameters (size,type. Etc.) and the program search in a 'database' and draw the object.

This 'database' is now a simple.txt file and I would like to make it an.xls file in order to become more easy to add, change, delete etc. I have no idea if with Lisp it's possible to open, read, search, extract and use data from a.xls file.

First step, first question - it's possible to do this with Lisp? I have a Lisp program which draw objects acc. To different standards (self made).

The user indicates the parameters (size,type. Etc.) and the program search in a 'database' and draw the object. This 'database' is now a simple.txt file and I would like to make it an.xls file in order to become more easy to add, change, delete etc. I have no idea if with Lisp it's possible to open, read, search, extract and use data from a.xls file. First step, first question - it's possible to do this with Lisp?Hi danielgh Can you send the part of your text file in order to actually help to you more effectively Thank you f.

Fixo, attached is one of the files I am using. Please let me know if you need more informations. Thank you, DanielHi Daniel I have some questions 1. For the best conversion of a text file to file Excel it is necessary to replace all empty columns in a text file on any letter, for example on '-' 2. Here there is not clear algorithm - what is designate variable S0, S10, S30 etc etc 3. Figure is necessary, for example, what are you draw according to the first line text file 4.

If it does not represent interest for other users that it will be logical to bear this problem out of a forum, if so, you can send all files to me personally 5. Try these routine you shall see result I saw Thank you f.

Vlax-import-type-library (autolisp/activex Autocad For Mac