Jump to content

Recommended Posts

Posted
  On 1/4/2025 at 1:02 AM, BIGAL said:

If you look at this image its a make layouts walking along a line or pline. It auto rotates the viewport to suit, I could add the what is previous page and what is next page, I am getting confused as to why you want to use hyperlinks. For a single road style plan then the before after is relatively easy, when we get to grid layouts a sheet can have say 4 sheets touching. You can get all layout names and there corresponding TABORDER. So labelling multiple layouts could be done.

layout1.png.9d03ab6cd7fbd5b4a128c15fbe0c31bf.png

 

Expand  

Hyperlink is for output pdf. It will be easier for the reviewer. 

 

Can you send a video of how its doing layout automatically? Is automatically NORTH arrow direction adjusted with this lisp?

Posted

I use a plot range of layouts to pdf, just do like 3 to 5 or 1 to 999 which is plot all. I use a make index from title blocks so know sheet range.

 

The make layouts is two steps, make the rectangle at desired scale, matching a title block. You can move delete rotate etc, then part two make layouts. The cost is a cup of coffee as I have to set it up to suit your title blocks. There is a grid style option as well.

 

yes have rotate north arrow to match viewport rotation.

 

Yes I have draw a grid on the viewport also.

Posted
  On 1/4/2025 at 10:15 PM, BIGAL said:

I use a plot range of layouts to pdf, just do like 3 to 5 or 1 to 999 which is plot all. I use a make index from title blocks so know sheet range.

 

The make layouts is two steps, make the rectangle at desired scale, matching a title block. You can move delete rotate etc, then part two make layouts. The cost is a cup of coffee as I have to set it up to suit your title blocks. There is a grid style option as well.

 

yes have rotate north arrow to match viewport rotation.

 

Yes I have draw a grid on the viewport also.

Expand  

Okay. Thank you

Posted
  On 1/3/2025 at 10:30 PM, smitaranjan said:

eg: foo--> layout list or custom-->(if layout list is selected as usual above code process)--> layout no.-->select objects to add the link(multiple object can be selected at a time{individual hyperlink entity})--> enter---> layout no.-->select objects to add the link {after entering esc the process will end}

 

@smitaranjan OK this is a bit more involved for the layout select - Give this a try:

I'm using Lee Mac's List Box V1.2 for the layout select dialog: https://www.lee-mac.com/listbox.html

(defun c:LLINK (/ ch e ll ly ss)
   (vl-load-com)

   (initget "Select All")
   (if (not (setq ch (getkword "\nSelect a Single Layout or All [Select/All] <Select>: ")))(setq ch "Select"))
   
   (cond
      ((= ch "Select")
         (setq ll (layoutlist))
         (if 
            (and
               (setq ly (LM:listbox "Select a Layout to Link:" ll 0))
               (setq ss (ssget))
            )
            (repeat (setq c (sslength ss))
               (setq e (ssname ss (setq c (1- c))))
               (vla-add
                  (vla-get-hyperlinks (vlax-ename->vla-object e))
                  ""                  ;; External Hyperlink
                  (strcat "Go to " (car ly)) ;; display description
                  (strcat "," (car ly))      ;; Named location in the document
               ) 
            )
         )
      )
      ((= ch "All")
         (foreach n (layoutlist) ;; for each layout name,
            (if (setq e (entsel (strcat "\nSelect Object to link to \"" n "\""))) ;; select an object to add the link
               (vla-add
                  (vla-get-hyperlinks (vlax-ename->vla-object (car e)))
                  ""                  ;; External Hyperlink
                  (strcat "Go to " n) ;; display description
                  (strcat "," n)      ;; Named location in the document
               )
            )
         )
      )
   )
   (princ)
)


;; List Box  -  Lee Mac
;; Displays a DCL list box allowing the user to make a selection from the supplied data.
;; msg - [str] Dialog label
;; lst - [lst] List of strings to display
;; bit - [int] 1=allow multiple; 2=return indexes
;; Returns: [lst] List of selected items/indexes, else nil
(defun LM:listbox ( msg lst bit / dch des tmp rtn )
    (cond
        (   (not
                (and
                    (setq tmp (vl-filename-mktemp nil nil ".dcl"))
                    (setq des (open tmp "w"))
                    (write-line
                        (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
                            (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}"
                        )
                        des
                    )
                    (not (close des))
                    (< 0 (setq dch (load_dialog tmp)))
                    (new_dialog "listbox" dch)
                )
            )
            (prompt "\nError Loading List Box Dialog.")
        )
        (   t     
            (start_list "list")
            (foreach itm lst (add_list itm))
            (end_list)
            (setq rtn (set_tile "list" "0"))
            (action_tile "list" "(setq rtn $value)")
            (setq rtn
                (if (= 1 (start_dialog))
                    (if (= 2 (logand 2 bit))
                        (read (strcat "(" rtn ")"))
                        (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))
                    )
                )
            )
        )
    )
    (if (< 0 dch)
        (unload_dialog dch)
    )
    (if (and tmp (setq tmp (findfile tmp)))
        (vl-file-delete tmp)
    )
    rtn
)

 

  • Thanks 1
Posted
  On 1/6/2025 at 2:41 PM, pkenewell said:

 

@smitaranjan OK this is a bit more involved for the layout select - Give this a try:

I'm using Lee Mac's List Box V1.2 for the layout select dialog: https://www.lee-mac.com/listbox.html

(defun c:LLINK (/ ch e ll ly ss)
   (vl-load-com)

   (initget "Select All")
   (if (not (setq ch (getkword "\nSelect a Single Layout or All [Select/All] <Select>: ")))(setq ch "Select"))
   
   (cond
      ((= ch "Select")
         (setq ll (layoutlist))
         (if 
            (and
               (setq ly (LM:listbox "Select a Layout to Link:" ll 0))
               (setq ss (ssget))
            )
            (repeat (setq c (sslength ss))
               (setq e (ssname ss (setq c (1- c))))
               (vla-add
                  (vla-get-hyperlinks (vlax-ename->vla-object e))
                  ""                  ;; External Hyperlink
                  (strcat "Go to " (car ly)) ;; display description
                  (strcat "," (car ly))      ;; Named location in the document
               ) 
            )
         )
      )
      ((= ch "All")
         (foreach n (layoutlist) ;; for each layout name,
            (if (setq e (entsel (strcat "\nSelect Object to link to \"" n "\""))) ;; select an object to add the link
               (vla-add
                  (vla-get-hyperlinks (vlax-ename->vla-object (car e)))
                  ""                  ;; External Hyperlink
                  (strcat "Go to " n) ;; display description
                  (strcat "," n)      ;; Named location in the document
               )
            )
         )
      )
   )
   (princ)
)


;; List Box  -  Lee Mac
;; Displays a DCL list box allowing the user to make a selection from the supplied data.
;; msg - [str] Dialog label
;; lst - [lst] List of strings to display
;; bit - [int] 1=allow multiple; 2=return indexes
;; Returns: [lst] List of selected items/indexes, else nil
(defun LM:listbox ( msg lst bit / dch des tmp rtn )
    (cond
        (   (not
                (and
                    (setq tmp (vl-filename-mktemp nil nil ".dcl"))
                    (setq des (open tmp "w"))
                    (write-line
                        (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
                            (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}"
                        )
                        des
                    )
                    (not (close des))
                    (< 0 (setq dch (load_dialog tmp)))
                    (new_dialog "listbox" dch)
                )
            )
            (prompt "\nError Loading List Box Dialog.")
        )
        (   t     
            (start_list "list")
            (foreach itm lst (add_list itm))
            (end_list)
            (setq rtn (set_tile "list" "0"))
            (action_tile "list" "(setq rtn $value)")
            (setq rtn
                (if (= 1 (start_dialog))
                    (if (= 2 (logand 2 bit))
                        (read (strcat "(" rtn ")"))
                        (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))
                    )
                )
            )
        )
    )
    (if (< 0 dch)
        (unload_dialog dch)
    )
    (if (and tmp (setq tmp (findfile tmp)))
        (vl-file-delete tmp)
    )
    rtn
)

 

Expand  

THANK YOU. ITS WORKING PROPERLY

  • Like 1

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