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

Determine if data link exists

10 REPLIES 10
Reply
Message 1 of 11
ljacobs
700 Views, 10 Replies

Determine if data link exists

Is there a way to determine if a table has a data link thru lisp? what im trying to do is when a drawing is opened it searches to see if there are any data links in the drawing, if so then it updates all data links. Right now I wrote a routine that looks for tables and if they exist it runs the update all data links command however if there is a table in the drawing but no data links then at the command line you get an unknown command because no data links exist in the drawing for it to update.
10 REPLIES 10
Message 2 of 11
devitg
in reply to: ljacobs

Show your lisp .

Please use RICH TEXT option at the Discussion Group 's editor

Or send it to my e mail

my-user-name-here @ gmail.com

erase spaces
Message 3 of 11
EC-CAD
in reply to: ljacobs

You may want to use VLisp command:
(vl-catch-all-apply
or
(vl-catch-all-error-p

.. to bypass those types of errors..

Bob
Message 4 of 11
Anonymous
in reply to: ljacobs


Why are asking him for his code?


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Show
your lisp .

Please use RICH TEXT option at the Discussion Group 's
editor

Or send it to my e mail

my-user-name-here @ gmail.com


erase spaces
Message 5 of 11
devitg
in reply to: ljacobs

  1. It is not forbidden to do.
  2. I like to see what it is done about a topic.
  3. As I have the free to ask , he have the free to not answer or give it.
Nothing else.
Message 6 of 11
Anonymous
in reply to: ljacobs


I really think you need to stop asking people for their
code,

especially when it is obvious that you can't help them
or

when the answer doesn't require you to see the
code.


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


  1. It is not forbidden to do.
  2. I like to see what it is done about a topic.
  3. As I have the free to ask , he have the free to not answer or give it.
Nothing else.
Message 7 of 11
Anonymous
in reply to: ljacobs


To do it, you have to search each datalink's entity
data for

the entity name of the table.

 

The datalinks live in a dictionary named
"ACAD_DATALINKS"

(a child of the named objects dictionary).

 

Each item in the ACAD_DATALINKS dictionary is a
datalink.

 

Each datalink's entity data contains
the entity name(s) of

the table(s) that reference the datalink,
which are stored

in DXF 330 groups.


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Is
there a way to determine if a table has a data link thru lisp? what im trying
to do is when a drawing is opened it searches to see if there are any data
links in the drawing, if so then it updates all data links. Right now I wrote
a routine that looks for tables and if they exist it runs the update all data
links command however if there is a table in the drawing but no data links
then at the command line you get an unknown command because no data links
exist in the drawing for it to update.
Message 8 of 11
devitg
in reply to: ljacobs

At least , if I can help or not , I think that this place is made to share knowledges.

And at last, I do no post commercial link on my posts.

Message 9 of 11
ljacobs
in reply to: ljacobs

Thanks that got me going in the right direction.
Message 10 of 11
rklee
in reply to: ljacobs

Do you know of a way to retreive the path of the datalink? I am trying to check if the Excel file is open prior to doing a Write to data source from within AutoCad. I have found out that AutoCad will act like that data was written out, but if the Excel file is open, the data does not get written to it. Any help would be appreciated. I have browsed using Vlisp capabilities, but can not find the path.
Message 11 of 11
Anonymous
in reply to: ljacobs


Maybe you should check those dictionaries that Tony
is talking about. Generaly, there is a lot of stuff attached to dictionaries,
just try to dig deeper, interogating those (entget (assoc ...)) of the DXF codes
that you suspect that might hide some relevant information. Sometimes is just
guessing, but, hey, this is it 🙂

 

HTH


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Do
you know of a way to retreive the path of the datalink? I am trying to check
if the Excel file is open prior to doing a Write to data source from within
AutoCad. I have found out that AutoCad will act like that data was written
out, but if the Excel file is open, the data does not get written to it. Any
help would be appreciated. I have browsed using Vlisp capabilities, but can
not find the path.

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

Post to forums  

Autodesk Design & Make Report

”Boost