Author Topic: attribute edit  (Read 7142 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: attribute edit
« Reply #30 on: April 20, 2016, 08:44:35 AM »
Sorry, unless you provide more info I can't help you.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

AIberto

  • Guest
Re: attribute edit
« Reply #31 on: April 20, 2016, 09:38:41 AM »
Sorry, unless you provide more info I can't help you.

Dear MP

I invited a friend to help me test , He is a  Lisp Master.  At his side. Still Error .



AIberto

  • Guest
Re: attribute edit
« Reply #32 on: April 20, 2016, 09:43:31 AM »
if prompt is empty , test Error.
if prompt is not empty .test ok!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: attribute edit
« Reply #33 on: April 20, 2016, 09:54:01 AM »
Have LISP master substitute "-" instead of (chr 160).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

AIberto

  • Guest
Re: attribute edit
« Reply #34 on: April 20, 2016, 11:56:01 AM »
Have LISP master substitute "-" instead of (chr 160).

Dear MP ,I can't understand. :-(

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: attribute edit
« Reply #35 on: April 20, 2016, 01:19:28 PM »
I'd assume Michael means :
Change this :
Code - Auto/Visual Lisp: [Select]
  1.     (defun _GetPrompt ( attrib / result )
  2.         (if (eq "" (setq result (_Trim (vla-get-promptstring attrib))))
  3.             (chr 160)
  4.             result
  5.         )
  6.     )
  7.  

to this :
Code - Auto/Visual Lisp: [Select]
  1.     (defun _GetPrompt ( attrib / result )
  2.         (if (eq "" (setq result (_Trim (vla-get-promptstring attrib))))
  3.             ;;("-") fix error:kdub
  4.             "-"
  5.             result
  6.         )
  7.     )
  8.  

note : I haven't followed the complete thread so I may be incorrect.

edit:repair error
« Last Edit: April 20, 2016, 01:28:12 PM by kdub »
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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: attribute edit
« Reply #36 on: April 20, 2016, 01:21:43 PM »
Yes + thanks. I'm at work and cannot play.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: attribute edit
« Reply #37 on: April 20, 2016, 01:25:48 PM »
Actually "-", not ("-"). Missed as I'm viewing on my diminutive phone. Thx KB.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: attribute edit
« Reply #38 on: April 20, 2016, 03:35:06 PM »
Strange... to me it works without any modification, if I add a print before dos_proplist:
Code: [Select]
...
                   (print
                      (mapcar
                       (function (lambda ( a ) (cons (car a) (cadr a))))
                        attribs
                      )
                    )
                    (setq result
                        (dos_proplist "MyEd" "Modify Attributes"
                            (mapcar
                                (function (lambda ( a ) (cons (car a) (cadr a))))
                                attribs
                            )
                        )
                    ) 
...
    (defun _GetPrompt ( attrib / result )
        (if (eq "" (setq result (_Trim (vla-get-promptstring attrib))))
            (chr 160)
            result
        )
    ) 
I get:

((" " . "Mark") (" " . "Male") (" " . "NO.4") (" " . "15"))
    ^ space

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: attribute edit
« Reply #39 on: April 20, 2016, 03:47:14 PM »
The mod was only meant for AIberto as I suspect the character set on his computer is making DOSLIB chuck a wobbly.

But thanks for testing sir! :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: attribute edit
« Reply #40 on: April 20, 2016, 04:01:11 PM »
The mod was only meant for AIberto as I suspect the character set on his computer is making DOSLIB chuck a wobbly.

But thanks for testing sir! :)
Prego Brav'uomo.  :wink:

AIberto

  • Guest
Re: attribute edit
« Reply #41 on: April 21, 2016, 06:19:30 AM »
Thanks MP & kb

problem solved ! You're a good guy :smitten:

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: attribute edit
« Reply #42 on: April 21, 2016, 08:40:36 AM »
I had heard of the Turkey test a while ago but I ignored it for the most part; when would my code ever be run by anyone in Turkey (which, after reading up on the subject I learned that, isn't the point) and/but no one, besides me, runs my code. ...The above is a good example of the Turkey test and I think I am finally going to take the problem more seriously and start reading up on it again.

Great detective work, MP!

ref: Turkey test
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: attribute edit
« Reply #43 on: April 21, 2016, 06:54:01 PM »
Thanks AIberto; John.

FYI, I dumped the notion of using the attribute prompts. As David had mentioned, if there is not perfect synchronization between attribute sequencing and the associated block def the prompting would be out of wack. Worse, if attributes instances are created completely independent of a block def, e.g. AutoCAD Electrical, prompts are not to be realized.

The program in my original post was modified accordingly. It still sorts the attributes from top to bottom, left to right, but displays the tags instead of the prompts, thus should work on any insert with attributes, regardless how the attributes were birthed.

Cheers.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst