Author Topic: top level xref in model space  (Read 9514 times)

0 Members and 1 Guest are viewing this topic.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #15 on: November 05, 2007, 01:54:49 PM »
Tim,

No. Nothing happens. I think it does not recognized the entity I selected.
Told you, my parent block is nested to the nth degree.

Robert,

T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #16 on: November 05, 2007, 02:01:44 PM »
Run this, and post a pic of what is in the alert box.  This will help figure out what is happening.
Code: [Select]
(defun c:NList (/ Sel EntList Data tempType NListString)

(setq NListString "")
(if (setq Sel (nentsel "\n Select object to list properties of it, and of partent entities if nested: "))
(progn
(if (> (length Sel) 2)
(setq EntList (append (list (car Sel)) (last Sel)))
(setq EntList (list (car Sel)))
)
(foreach ent EntList
(if (equal (type ent) 'ENAME)
(progn
(setq Data (entget Ent))
(setq NListString
(strcat
NListString
"\n Entity type: "
(setq tempType (cdr (assoc 0 Data)))
(cond
(
(and
(= tempType "INSERT")
(/=
(cdr
(assoc
1
(entget
(tblobjname
"block"
(cdr
(assoc 2 Data)
)
)
)
)
)
""
)
)
(strcat
" [ Xref - "
(cdr (assoc 2 Data))
" ]"
)
)
((= tempType "INSERT")
(strcat
" [ "
(cdr (assoc 2 Data))
" ]"
)
)
(T "")
)
"\n    Layer: "
(cdr (assoc 8 Data))
"\n    Linetype: "
(if (assoc 6 Data)
(cdr (assoc 6 Data))
"ByLayer"
)
"\n    Color: "
(if (assoc 62 Data)
(itoa (cdr (assoc 62 Data)))
"ByLayer"
)
"\n"
)
)
)
)
)
(alert NListString)
)
)
(princ)
)
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #17 on: November 05, 2007, 02:16:44 PM »

Okay..Hope this helps.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #18 on: November 05, 2007, 02:27:44 PM »
There will be a problem with the 'single' option, but the 'all' option should work.  The only problem that I can see is that the code will not change nested xref layer properties.  If that is what you want, then the code will need to be changed.  This line of code
Code: [Select]
(if (and (not (vl-string-search "|" LayName)) (/= LayName "0") (/= (strcase LayName) "DEFPOINTS"))is saying that if the layer name doesn't have the pipe symbol, which and xref layer would, and is not named '0' or 'defpoints' then update the layer within the current drawing to the settings of that in the xref file.

So you can use it as a guide to make your own routine to emulate how you do your drawings.

Hope it helped a little.
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #19 on: November 05, 2007, 02:35:46 PM »
Tim,

Thank you. Yes, I know I will learn a lot from your example.
I hope I did not take most of your time.

Many Thanks,
Robert

T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #20 on: November 05, 2007, 03:08:29 PM »
Tim,

Thank you. Yes, I know I will learn a lot from your example.
I hope I did not take most of your time.

Many Thanks,
Robert
You're welcome Robert.  If you run into a problem with your code, just post and I'm sure you will get some help.  There are a lot of smart people here.
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #21 on: November 06, 2007, 02:43:23 PM »
Hello again,

Quick question with lisp..Is there a quick & easy way to thaw and turn on all the layers in
"Model Space" only?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #22 on: November 06, 2007, 03:00:21 PM »
Don't know what you mean by "Model space only".  Once you thaw or turn on a layer it is affected in the whole drawing, unless it is frozen or off within a viewport.
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #23 on: November 06, 2007, 03:19:38 PM »
Hi Tim,

In the Plot Sheet, I want to  first thaw & turn on first all the layers of the Parent Xref drawing (which
is located in model space). Before I apply the layer settings (the ones that are frozen & turned off collected
with ObjectDbx).

In paper space I have my title block drawing. There may be some layers frozen (ex. Key Plan, graphic scale..)
I want them to remain frozen/off.

Did I make sense?


T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #24 on: November 06, 2007, 03:59:28 PM »
You could step through the model space block definition and collect a list of all the layers that are assigned, but I would think that would take a long time because then you would have to step through each block definition, and see if they have attributes associated with the inserted block.  If you are only concerned about the xref layers, then that should be easy enough.
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #25 on: November 06, 2007, 04:20:14 PM »
Yeah, that was what I was afraid of. Its going to going to take time.
Oh well. Thanks again Tim.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #26 on: November 06, 2007, 05:01:06 PM »
The code wouldn't be hard to write.  So you could test it to see if it takes too much time, because maybe it won't take that much.  I don't want to scare you about time because it depends on what items you have in model space, and how many.

You're welcome Robert.
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #27 on: November 06, 2007, 05:45:51 PM »
Tim,

A thought just occured to me as I was driving home. Instead of "stepping through the model space block definition".
I will step through the "Paper Space" block definition. Since I know it has only one block/xref (the title block) and it
its not nested. It may only have 10 layers at the most.

Things are looking up. Now I have go fishing for the code.


Robert


T.Willey

  • Needs a day job
  • Posts: 5251
Re: top level xref in model space
« Reply #28 on: November 06, 2007, 05:53:30 PM »
Just make sure you step through all paper space tabs then, but it sounds like it could be a good idea.
Tim

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

Please think about donating if this post helped you.

Robert_s

  • Guest
Re: top level xref in model space
« Reply #29 on: November 06, 2007, 06:00:02 PM »
Good point. Fortunately our office policy is only one layout tab per drawing.