Jump to content

Recommended Posts

Posted

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

Posted
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. 

Posted

Devitg will give you an answer but you can also just read the cells direct from excel. Maybe Version 2.

 

image.thumb.png.32259637fc143209b52c1ac0d330865e.png

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.

Posted
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

Posted

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. 

 

image.thumb.png.e38576762d4842c82dc2982ab7a4b369.png

 

 

Posted (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:

 

image.png.588b51c25c6ea326853ace62302d57fe.png

 

 

 

 

Edited by devitg
add image
Posted (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 by BIGAL
Posted

@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 .

 

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...