Author Topic: Attdisp Normal vs ON  (Read 8439 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Attdisp Normal vs ON
« Reply #30 on: May 06, 2010, 01:41:54 PM »
any chance .Net can touch it?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Attdisp Normal vs ON
« Reply #31 on: May 06, 2010, 02:22:50 PM »
Doubtful, as I would guess the .NET interface honors the same intent as the ActiveX interface, i.e.the Constant property etc. is read-only.

However, if you go thru an ObjectArx wrapper you could probably make them squeal like a pig.
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Attdisp Normal vs ON
« Reply #32 on: May 06, 2010, 03:36:57 PM »
Doubtful, as I would guess the .NET interface honors the same intent as the ActiveX interface, i.e.the Constant property etc. is read-only.

Confirmed.  I couldn't even compile the code when trying to change the IsContstant property.  Just a quick test though.  Didn't try anything else as a work around.
Tim

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

Please think about donating if this post helped you.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Attdisp Normal vs ON
« Reply #33 on: May 06, 2010, 03:38:45 PM »
BUMMER, ok, I have to ask, can you post the LISP code?  Its been forever since I did any lisp, so I will spend more time floundering than its worth at this point.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Attdisp Normal vs ON
« Reply #34 on: May 06, 2010, 03:40:06 PM »
My other question might lend itself to the discussion, How could I insert a block with attributes, use code to fill out the constant, or if its not constant, lock it from editing
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Attdisp Normal vs ON
« Reply #35 on: May 06, 2010, 03:48:44 PM »
To make an attribute constant, change dxf code 70 to 2.

(setq ent (entget (nentsel)))
(entmod (subst (cons 70 2) (assoc 70 ent) ent))

You can still change the contents with code.
(entmod (subst (cons 1 "test") (assoc 1 ent) ent))

Hope that helps.

If you want to insert a block with attributes, then you have to create all the items with dxf codes.  If you want it easier, then you can use the ActiveX way to insert, then just edit the attributes with dxf codes after.  Ron just posted a routine to create a block within a drawing, as block I mean insert.
[ http://www.theswamp.org/index.php?topic=33237.0 ]

Edit:  Add the bit code for code 70 of attributes.

70
 Attribute flags:

1 = Attribute is invisible (does not appear)

2 = This is a constant attribute

4 = Verification is required on input of this attribute

8 = Attribute is preset (no prompt during insertion)
 
Tim

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

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Attdisp Normal vs ON
« Reply #36 on: May 06, 2010, 03:49:12 PM »
You can do it at least 2 ways Cmdr. You can entmake the attributes when you entmake the block instances, setting the constant flag in the 70 group or you can set the constant flag in the 70 group after the block instance and the attribute(s) are made. What you do not want to do is define the attribute of interest as a constant attdef in the block def. When you do that said attribute is common to all block instances of that block. Clear as mud?
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Attdisp Normal vs ON
« Reply #37 on: May 06, 2010, 03:53:56 PM »
To make an attribute constant, change dxf code 70 to 2 ...

Keep in mind you want to perform a bitwise or, using the existing group 70 value and 2:

(logior 2 (cdr (assoc 70 dxfdata))) ...

If you set it to 2 you could unwittingly nuke the invisible state etc.
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Attdisp Normal vs ON
« Reply #38 on: May 06, 2010, 03:58:28 PM »
To make an attribute constant, change dxf code 70 to 2 ...

Keep in mind you want to perform a bitwise or, using the existing group 70 value and 2:

(logior 2 (cdr (assoc 70 dxfdata))) ...

If you set it to 2 you could unwittingly nuke the invisible state etc.

Yea.  That's why I edited my post to show the bit codes for dxf code 70.  Thanks for stating it clearer.  I forgot we are not in the lisp forum.
Tim

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

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Attdisp Normal vs ON
« Reply #39 on: May 06, 2010, 04:09:25 PM »
I knew you knew Tim, was just making sure the audience greater was informed.

And for the audience greater, to "mask off" the constant bit do this:

(logand -3 (cdr (assoc 70 dxfdata))) ...

or this if you don't like "magic" numbers:

(logand (~ 2) (cdr (assoc 70 dxfdata))) ...

Keep in mind you do not have to revert the attribute to a non constant state to change the attribute's value (dxf group 1 | activex property 'textstring) from code, using either dxf or activex methods.
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Attdisp Normal vs ON
« Reply #40 on: May 07, 2010, 09:19:05 AM »
mud, definetly mud.  I will have to get back to you on this.  At least I know I can do something, just not sure what yet.  Thanks
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)