Author Topic: Entmake Insert + attrib  (Read 8604 times)

0 Members and 1 Guest are viewing this topic.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Entmake Insert + attrib
« on: February 26, 2009, 03:27:04 PM »
Driving me crazy.

I have created a block using entmake including attrdef's but when I try to create the insert based on that block with attrib's I get unexpected results.

Am I doing something wrong?
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Entmake Insert + attrib
« Reply #1 on: February 26, 2009, 03:29:57 PM »
Hard to tell without code.   :wink:

Here is how I add extra attributes to blocks, which recreates the insert and all attributes, so I think it will show you a way to do it.

[ http://www.theswamp.org/index.php?topic=8037.0 ]
Tim

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

Please think about donating if this post helped you.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Entmake Insert + attrib
« Reply #2 on: February 26, 2009, 03:34:01 PM »
Sorry 'bout that:

Code: [Select]
(defun FRAM_BUBBLE (/)

;; Create framing marker block
;; Check for the block if it is not there, create it
(if (not (tblsearch "block" "ID1"))
(progn
(entmake
(list
(cons 0 "BLOCK")
(cons 2 "ID1")
(cons 4 "Framing ID marker")
(cons 70  2)
(cons 10 (list 0.0 0.0 0.0))
(cons 8  "11T")
)
)
;; STDLIB_LAKEPLINE <POINTLIST> <LAYER> <LINETYPE> <COLOR> <CLOSE>
(STDLIB_MAKECIRC (list 0.0 0.0 0.0) 7.0 "11T" "Continuous")
(entmake
(list
(cons 0 "ATTDEF") ;; Entity type
(cons 1 "") ;; Attrib Value
(cons 2 "RTAG1") ;; Attrib Tag
(cons 3 "ID") ;; Attrib Prompt
(cons 7 "1T14") ;; Textstyle
(cons 8 "11T") ;; Layer
(cons 10 (list 0 0 0)) ;; First alignment point
(cons 11 (list 0 0 0)) ;; Second alignment point
(cons 40 4.0) ;; Text height
(cons 70 2) ;; Attribute flags
(cons 71 0) ;; Text generation flags
(cons 72 1) ;; Horizontal text justification type
(cons 74 2) ;; Vertical text justification type
)
)
(entmake
(list
(cons 0 "ENDBLK")
)
)
)
)
(princ)
)
^^ Code to create the block

Code: [Select]
(defun FRAM_INSERT_BUBBLE (InsPoint Value /)

;; Insert block framing marker
(entmake
(list
(cons 0 "INSERT") ;; Entity type
(cons 2 "ID1")
(cons 8 "0")
(cons 10 InsPoint)
(cons 50 0.0)
(cons 70 0)
(cons 66 1) ;; Attribute follow
)
)
(entmake
(list
(cons 0 "ATTRIB") ;; Entity type
(cons 1 Value) ;; Attrib Value
(cons 2 "RTAG1") ;; Attrib Tag
(cons 7 "1T14") ;; Textstyle
(cons 8 "11T") ;; Layer
(cons 10 InsPoint) ;; First alignment point
(cons 11 InsPoint) ;; Second alignment point
(cons 40 4.0) ; Text height
(cons 70 0) ;; Attribute flags: 8
(cons 71 0) ;; Text generation flags
(cons 72 1) ;; Horizontal text justification type
(cons 74 2) ;; Vertical text justification type
)
)
(entmake
(list
(cons 0 "SEQEND") ;; Entity type
(cons 8 "0") ;; Layer
)
)
)
^^Code to create the insert


Everything works except when i try to edit the insert there is no "Prompt"

Why?  What am I doing wrong
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Entmake Insert + attrib
« Reply #3 on: February 26, 2009, 04:16:03 PM »
I don't know how the command knows about the prompt, as I haven't figured that part out yet.  Maybe someone will be able to chime in, and enlighten us both.  Sorry Tim.
Tim

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

Please think about donating if this post helped you.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Entmake Insert + attrib
« Reply #4 on: February 26, 2009, 04:49:44 PM »
Worst part is that if the block is already in the dwg (from the library) everything works as expected...

Hope someone can shed some light on this for me. (us)
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Entmake Insert + attrib
« Reply #5 on: February 26, 2009, 04:58:32 PM »
My guess is that your code that defines the block def fails to make the attdef, tho it does succeed at making the block def.

While your call to make the insert, c/w attribute succeeds, there is no corresponding attdef entry in the block definition, so it cannot find the associated prompt.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Entmake Insert + attrib
« Reply #6 on: February 26, 2009, 05:37:27 PM »
Hi,

In the attdef entmake, change (cons 70 2) -constant attribute- to (cons 70 8 ) -predefined attribute-
« Last Edit: February 27, 2009, 08:50:13 AM by CAB »
Speaking English as a French Frog

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2125
  • class keyThumper<T>:ILazy<T>
Re: Entmake Insert + attrib
« Reply #7 on: February 26, 2009, 06:55:16 PM »

Just a general note about comments ...
Tim, If you had made the comments for the 70,71, 72, 74 keys explicit the 'error' may have become apparent.  :-)


Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Entmake Insert + attrib
« Reply #8 on: February 27, 2009, 07:30:50 AM »
Hi,

In the attdef entmake, change (cons 70 2) -constant attribute- to (cons 70 8 ) -predefined attribute-

That did the trick....Thanks
« Last Edit: February 27, 2009, 08:50:28 AM by CAB »
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016