Slobo_76 Posted March 6, 2023 Posted March 6, 2023 Hello all, I need to create multiple spheres (mesh 3D model) with hyperlink from excel file in AutoCAD. Excel file contains the name, position, diameter and hyperlink of sphere. The hyperlink should be attached to a sphere created from a mesh model, not a block. Is it possible to do this automatically with lisp or some other tools? Thank you for help! Test_hyperlink.csv Test_Buble_Views.dwg Quote
devitg Posted March 6, 2023 Posted March 6, 2023 2 hours ago, Slobo_76 said: Hello all, I need to create multiple spheres (mesh 3D model) with hyperlink from excel file in AutoCAD. Excel file contains the name, position, diameter and hyperlink of sphere. The hyperlink should be attached to a sphere created from a mesh model, not a block. Is it possible to do this automatically with lisp or some other tools? Thank you for help! Test_hyperlink.csv 495 B · 1 download Test_Buble_Views.dwg 2.69 MB · 1 download @Slobo_76. Yes, it is possible. I will try to do. Quote
BIGAL Posted March 6, 2023 Posted March 6, 2023 Devitg will give you an answer but you can also just read the cells direct from excel. Maybe Version 2. In Autocad / Bricscad a list is returned (("Scan Name" "Northing" "Easting " "Elevation" "Diameter" "Link") ("CTR060_DS02_001" 91.856336 194.028469 21.357924 0.25 "https://sitespot.fugro.com/clients/e.......") ("CTR060_DS02_002" 77.676962 197.438299 21.559373 0.25 "https://sitespot.fugro.com/clients/e.......")) If the excel is always the same 5 columns then can just go and read no need for selection. Start at row 2. Quote
devitg Posted March 7, 2023 Posted March 7, 2023 On 3/6/2023 at 9:15 AM, Slobo_76 said: Hello all, I need to create multiple spheres (mesh 3D model) with hyperlink from excel file in AutoCAD. Excel file contains the name, position, diameter and hyperlink of sphere. The hyperlink should be attached tphere created from a mesh model, not a block. Is it possible to do this automatically with lisp or some other tools? Thank you for help! Test_hyperlink.csv 495 B · 1 download Test_Buble_Views.dwg 2.69 MB · 1 download @Slobo_76. give a try MESH SPHERE + HYPERLINK.lsp Quote
Slobo_76 Posted March 8, 2023 Author Posted March 8, 2023 Hi Devitg, many thanks for your help regarding this issue. After I run your lisp with command SPH+HYP and select my test excel csv. file in open window, I got message:"; error: bad argument type: stringp nil". I tried to modify csv file but no success. Also, I use AutoCAD version 2017. Not sure is problem on my part but, could you try to run my CSV test file with your LISP and let me know if it works on your side? Thank you and best regards. Quote
devitg Posted March 8, 2023 Posted March 8, 2023 (edited) @Slobo_76 maybe it is about the way your window system deal with comma separator. change this part (WHILE (SETQ LINEA (READ-LINE AR)) (SETQ DATOS (STR-TOK LINEA ";")) (SETQ LINEA-LIST (CONS DATOS LINEA-LIST)) ) to (WHILE (SETQ LINEA (READ-LINE AR)) (SETQ DATOS (STR-TOK LINEA ",")) (SETQ LINEA-LIST (CONS DATOS LINEA-LIST)) ) I mean the ; by , i test it , and it work good. If error continue , please open by,F2, the command window, and copy from the start it shall be as follow Command: SPH+HYP Command: CONVTOSURFACE Mesh conversion set to: Smooth and optimized. Select objects: 1 found Select objects: Command: Command: CONVTOSURFACE Mesh conversion set to: Smooth and optimized. Select objects: 1 found Select objects: Command: Edited March 8, 2023 by devitg add image Quote
BIGAL Posted March 9, 2023 Posted March 9, 2023 (edited) CSV Comma separated values ? Yes Excel in some parts of the world uses the semi-colon ; as a separator. Been caught out before. Same with using a Comma "," v's a period "." in decimals 123.456 123,456 Edited March 9, 2023 by BIGAL Quote
devitg Posted March 9, 2023 Posted March 9, 2023 @BIGAL, yes here in my country, Argentina, some use , for thousands , and . for decimal , or any other combination , according the software developer. As follow 123.456,78 or 123,456.78 , and also 123456.78 or 123456,78 About CSV separator , once I saw a lisp that contemplate that possibility, so it dig , not know where, to get the CSV separator used. Think it should be at operating system registry key or what else . Thanks . Quote
Recommended Posts
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.