Jump to content

Title Block Updates from CSV


acad1985

Recommended Posts

Hello Everyone,

I've found a lisp routine by Lee-Mac in Here to update the Attribute Title Block from CSV file. i have a same task to be done.But in my drawing having different layout names and file Names. so i don't want to mention the file name and Layout name in CSV file. (Because i'm trying to update the csv using VBA Userform in AutoCAD, after updating title block will be updated automatically. so i don't want to enter the drawing and layout name).

@Lee Mac

Can you/anyone help me out to update the Title Block without drawing and Layout names in CSV file.

I appreciate any help! 

Link to comment
Share on other sites

You can use layout order which is a number rather than a name. have a look at this code its GOTO jumps to a layout by number.

 


; GOTO layout just like other goto a page
; By Alan H 2013
; menu command [GOTO]^c^C^p(load "goto")
; enter a big number like 99 to jump to last if 100+ layouts then 123 etc
; Model space is 0 zero GOTO 0

(defun C:goto ( / x alllayouts laynum num)
 (if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq num (atoi (nth 0  (AH:getvalsm (list "Go To A Layout" "Enter layout number" 5 4 "1")))))
(setq alllayouts (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
(SETQ LAYNUM 0)
(vlax-for x alllayouts
(Setq laynum (+ 1 laynum))
) ;total number of layouts
(if (> num laynum)
(setq num (- laynum 1))
)
(vlax-for lay alllayouts
(if (= num (vla-get-taborder lay))
(setvar "ctab" (vla-get-name lay))
)
)
)

; I often type it wrong so added this one also
(defun C:goot ()
(c:goto)
) ; defun

 

 

Link to comment
Share on other sites

Hi @BIGAL

Thanks for your Reply...You are correct we can use Layout numbers instead of Layout Name.

But in my drawing has different number of Layouts and also Drawing name is too long (alphabet with Numbers). so i couldn't enter it every time.

I'm going to combine this script with my routine (Automatic Layout Creation).

So i want to ignore the things mentioned below image

 

image.png.41d90ed04717458ba19c86e069431ec9.png

 

Thanks.

 

Link to comment
Share on other sites

The only way to not have a dwg name is to open the correct dwg then run a program, the layout could use the number order by ignoring "Layout1" starting at row 3 if layout to be skipped put something like blank or 0 . Or add a tick on in another column put a X. layout= row number - 2

 

Link to comment
Share on other sites

Thank you so much Bigal for your time.

I did this, Actually there is a option in lisp to running the command without layout name. And i get the current drawing name using VBA.

 

Thank you 😀

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