;======================================================================================================================================== End of Dialog BOx
[color=red](vl-load-com)[/color]
[color=red](setq vpent (car (nentsel "\nselect viewport"))) ;user selects viewport and viewport id is stored under vpent[/color]
[color=red](vlax-ename->vla-object vpent) ;vpent is transformed from an entity to a VLA object[/color]
[color=red](setq scale_fld (strcat "%<\AcObjProp.16.2 Object(%<\_ObjId "(vl-princ-to-string(vla-get-Objectid vpent))">%).CustomScale \f"%sn">%")) ;assigns field expression to variable.[/color]
(setq title_u (strcase title_n)) ;declaring additional variable to change case for title_n
(setvar "insunits" 0) ;setting insertion units to unitless for proper scale of inserted block
(command "insert" "N:/Tuterj/AutoLISP/Working/TitleMark-field.dwg" PT1 "" "" title_u scale_fld mark_n) ;inserting the contents of TitleMark drawing and inserting user input from dialog box.