Author Topic: ObjectDBX Xref for block  (Read 19711 times)

0 Members and 2 Guests are viewing this topic.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #75 on: December 19, 2007, 01:34:11 PM »
Guys, I found it!

Apparantly there is an exception that occurs when one chooses relative path versus full path. When full path is selected the code works fine.  Tim I will see how the code above works and if it has the same issue

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #76 on: December 19, 2007, 01:38:45 PM »
Glad you found it, but the new one won't matter because it doesn't use the path for anything (which sould make it faster).  The problem was that if it's not a real path, then it doesn't know where to find the drawing, so it can't open it up in the ObjectDBX app.  That would be an easy fix, you would just need to add a 'findfile' call here.
Code: [Select]
(setq dwgName InsName)
Change to
Code: [Select]
(setq dwgName (findfile InsName))
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #77 on: December 19, 2007, 01:44:36 PM »
Tim,

Your code for some reason did not scale down. I will also look into it and see what I can find. Either way thank you for another great example on how to code. I also have a new function to read up on
« Last Edit: December 19, 2007, 02:05:35 PM by Lexicon »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #78 on: December 19, 2007, 01:50:50 PM »
Tim,

Your code for some reason did not scale down. I will also look into it and see what I can find. Either way thank you for another great example on how to code.
You're welcome.  I have fixed what could be the problem (in the other post), as I didn't test it because I don't have your blocks, but I will here soon just to make sure what I posted works.  :-)

Edit:  After looking at the code, you may have to go the ObjectDBX route.  It looks like you are looking for title block blocks, and those are typically in a paper space layout, which wouldn't be in the block definition.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #79 on: December 19, 2007, 02:06:43 PM »
They are detail title blocks and are in the block definitions we use

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #80 on: December 19, 2007, 02:10:53 PM »
They are detail title blocks and are in the block definitions we use
But they would need to be inserted in model space in the xref, or the new code won't work.

ps.  I updated the code after testing it.  The problem was with searching for the name.  I forgot that when you search the way I do now it adds the xref to the name, so I had to change the way I looked at the blocks name.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #81 on: December 19, 2007, 02:14:09 PM »
Sorry, i wasn't very clear the first time. Everything within the detail xref is in model space. Wow, i can tell how much faster your code is. Probably fractions of a second but very noticible non-the-less. Terrific

Lisp now reads...

=======================
;;;   Overhauled by Tim Willey
;;;   12.19.2007
=======================

 :-D
« Last Edit: December 19, 2007, 02:28:31 PM by Lexicon »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #82 on: December 19, 2007, 03:29:30 PM »
Sorry, i wasn't very clear the first time. Everything within the detail xref is in model space. Wow, i can tell how much faster your code is. Probably fractions of a second but very noticible non-the-less. Terrific

Lisp now reads...

=======================
;;;   Overhauled by Tim Willey
;;;   12.19.2007
=======================

 :-D
You're welcome.

ObjectDBX is fast, but you still have to load the drawing (but at least not in the editor), but if you don't have to load the drawing why should we, and if we don't then it will be faster, which is the route I took in the second version.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #83 on: December 19, 2007, 04:22:49 PM »
Now is there any way to bypass the scale or rotation setting in the xref dialogue box or even make sure those two are always unchecked?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #84 on: December 19, 2007, 04:57:24 PM »
Now is there any way to bypass the scale or rotation setting in the xref dialogue box or even make sure those two are always unchecked?
If this routine was for me, I wouldn't even use the command 'xattach', I would do it all with code, but I didn't know if you liked to see the options the command has to offer or not.  If you just want to attach a file at a certain point with almost all options always the same, then I would just code up something like that.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #85 on: December 19, 2007, 05:01:25 PM »
Only problem is that I have no idea how to do dialogue boxes yet.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #86 on: December 19, 2007, 05:02:25 PM »
Only problem is that I have no idea how to do dialogue boxes yet.
You don't need a dialog box.  I would use the standard lisp function 'GetFiled'.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #87 on: December 19, 2007, 05:15:42 PM »
Schhhhhhhhvvvvvvvvvvveeeeeeeeeeet! Thats two today. I can have fun with this one. I'll see if i can learn how to incorporate it.


....wait. Actually I could of just went through the -xref command, no?
« Last Edit: December 19, 2007, 05:57:02 PM by Lexicon »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: ObjectDBX Xref for block
« Reply #88 on: December 19, 2007, 05:47:04 PM »
Schhhhhhhhvvvvvvvvvvveeeeeeeeeeet! Thats two today. I can have fun with this one. I'll see if i can learn how to incorporate it.


....wait. Actually I could of just went through the -xref command, no?
Yes if you knew where the file would be.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

OcCad

  • Guest
Re: ObjectDBX Xref for block
« Reply #89 on: December 19, 2007, 05:56:44 PM »
How would you use getfiled then to attach the drawing? And is there a way for the dia to remember the last folder that I was in?