Jump to content

automatic page changing


CadFrank

Recommended Posts

Hi i'm juste wondering if a lisp or something can set a attribute in a block to change automaticly according to the number or layout

 

So if i create a new layout the page goes to the next and the other show how many layout it opened

Link to comment
Share on other sites

Hi here is what im looking for

 

 

 

cartouche.JPG

 

i think with this the code line here :

 

(setq total (itoa (length (layoutlist))))

 

i could get what im looking for in the image that i have uploaded

 

cheers and merry christmas !!

 

hope some1 has and answer or when i come back to work ill get killed by my boss .. joke!!

Link to comment
Share on other sites

  • 3 weeks later...

Hi, sorry for the late reponse I was on vacation. Well i'm not to familliar with (SSM) would you know a place i could get a tutorial* or some information about it.

 

Thx

Link to comment
Share on other sites

You may want to use this code yet

I just tested it on converted A2009 format drawing

 

(defun C:paging(/ adoc atts id lay_field)
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
 (vlax-for lt (vla-get-layouts adoc)
   (vla-put-activelayout adoc lt);optional
   (vlax-for obj (vla-get-block lt)
     (if (eq "AcDbBlockReference" (vla-get-objectname obj))
(if (eq "Cartouche Aliance" (vla-get-effectivename obj))
       (if (eq :vlax-true (vla-get-hasattributes obj) )
       (progn
  (setq atts (vlax-invoke obj 'getattributes))
  (foreach x atts
    (if (eq "PAGE" (vla-get-tagstring x))
      (progn
        (setq id (vla-get-objectid (vla-get-layout (vla-objectidtoobject adoc (vla-get-ownerid obj)))))
        (setq lay_field (strcat "%<[url="file://\\AcObjProp"]\\AcObjProp[/url] Object(%<[url="file://\\_ObjId"]\\_ObjId[/url] " (itoa id)">%).Taborder [url="file://\\f"]\\f[/url] \"%tc1\">%"))
      (vla-put-textstring x lay_field)
      )
    )
  )
       )
    )
  )
)
     )
   )
 (vla-put-activelayout adoc (vla-item (vla-get-layouts adoc) 0));activate Layout1, optional
(princ)
 )
 (prompt "\Try command: Paging...")
 (prin1)
 (vl-load-com)
 (prin1)

 

~'J'~

Link to comment
Share on other sites

Well thank it works well to change the pages.

 

If i would want to make it so that the attribute "#page" inputs the total of layout is their a way.

Link to comment
Share on other sites

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...