Jump to content

Recommended Posts

Posted

Hi everybody,

as most of you know, vla-get-TextGenerationFlag function returns a number showing the condition of Upside Down and Backwards toggles inside Effects region of STYLE command's dialog.

How is it possible to find out whethere Vertical toggle is ON or OFF?

Posted

Dxf 70 = 4?

or are you you looking for more than just that? in Vlisp?

Posted
Dxf 70 = 4?

or are you you looking for more than just that? in Vlisp?

 

Thank you pBe for your prompt reply. Do you know a way to use it without opening the dwg (I mean ObjectDBX)?

Posted

tblnext

tblobjname

Flag (= 70 4)

 

Using our fellow member LM' ObjectDBXWrapper

i'm sure you will figure it out the rest

Posted
tblnext

tblobjname

Flag (= 70 4)

 

Using our fellow member LM' ObjectDBXWrapper

i'm sure you will figure it out the rest

 

Thanks a lot pBe. I appreciate your kind help. :)

Posted

Something like this might help you a bit

(while (setq a (tblnext "STYLE" (null a)))
     (if (eq (cdr (assoc 70
                         (entget (tblobjname
                                       "STYLE"
                                       (setq n    (cdr (assoc 2
                                                              a)))))))
             4)
           (print (strcat "Vertical Flag Found for style " n))))

 

HTH

Posted

Firstly, thanks for the recommendation pBe, I appreciate it.

 

Regarding your code, note that DXF Group 70 for a Text Style entity is bit-coded (in fact, Group 70 is almost always bit-coded), so you may be better to use:

 

(= 4 (logand 4 (cdr (assoc 70 <DXF Data>))))

 

However, I doubt that you can use tblnext / tblobjname / tblsearch with an ObjectDBX interface, but to my knowledge, this setting is no directly accessible through ActiveX.

 

The workaround might be:

 

(defun _isVertical ( doc style )
   (if
       (null
           (vl-catch-all-error-p
               (setq style
                   (vl-catch-all-apply 'vla-item
                       (list (vla-get-textstyles doc) style)
                   )
               )
           )
       )
       (= 4
           (logand 4
               (cdr
                   (assoc 70
                       (entget
                           (vlax-vla-object->ename style)
                       )
                   )
               )
           )
       )
   )
)

 

To pass this to my ObjectDBX Wrapper:

 

(LM:ODBX '(lambda ( doc ) (_isVertical doc "YourStyle")) nil nil)

Posted (edited)

shoot... i'm too slow a typist.

 

I reallize that too late when i tried to run a test.

 

I even tried to pass the vallue thru (vl-propagate 'Val) using tblobjname but no still no joy

(vlax-for txtt (vla-get-textstyles x))
                      (setq e (vlax-vla-object->ename txtt))
                       (if (eq (cdr (assoc 70
                         (entget (tblobjname
                                       "STYLE"
                                       (setq n (cdr (assoc 2
                                                              (entget e))))))))
             4)
           (progn
                 (setq dwgwidvert (cons (list (vla-get-fullname x) n) dwgwidvert))
                 (vl-propagate 'dwgwidvert)
                 )
                                   )
                                   )

 

 
([b][color=blue]vlax-vla-object->ename[/color][/b] style)<-----

 

That is what i ended up using as well..

 

 (= 4 (logand 4 (cdr (assoc 70 <DXF Data>)))) 

 

Thank you for the clarification :)

 

Cheers

Edited by pBe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...