Results 1 to 3 of 3

Thread: Block and VP scale insert

  1. #1
    Member
    Join Date
    2006-03
    Location
    The Cheese Capital of the World
    Posts
    48
    Login to Give a bone
    0

    Default Block and VP scale insert

    I have some problems with this code and was hoping someone could guide me in the right direction. If I run the first part of the code up to inserting the block I have the following to issues

    1) after inserting the block the prompt to "Select insertion point" stays on the command line

    2) Next to that it says Press enter to continue and when I do it returns with TITLE unknown command
    Code:
    (defun c:title ()
      (vl-load-com)
    
      (if(=(getvar "tilemode") 1)
         (setvar "tilemode" 0)
      )
    
      (command "_Insert" "G:\\PE Standards\\CAD\\BLOCKS AND SYMBOLS\\BLOCKS AND TAGS\\SHEETNOTE.DWG" (getpoint "\nSelect insertion point")  "" "" "" Pause)
    )
    3) However when I run the entire code I get misplaced dot on input.

    Code:
    (defun c:title2 ( / ent strfield objID)
      (vl-load-com)
    ;;;check for model space and switch to paper space
      (if(=(getvar "tilemode") 1)
        (progn
           (setvar "tilemode" 0)
         )
      )
      (command "_Insert" "G:\\PE Standards\\CAD\\BLOCKS AND SYMBOLS\\BLOCKS AND TAGS\\SHEETNOTE.DWG" (getpoint "\nSelect insertion point")  "" "" "" Pause)
    
    ;;; Select an object
      (if(setq ent (entsel)
        (progn
          (setq ent (car ent))
    
    
    :::Obtain object ID
      (progn
         (setq objID (vla-get-objectid (vlax-ename->vla-object ent)))
    
    ;;;Create field expression
            (setq strfield
    	  (strcat "%<\\AcObjProp Object(%<\\_ObjId "
    		(rtos objID 2 0)
    		>%).CustomScale \\f \"%lu4%pr8%ct2%qf2816 = 1'-0\"\">%
    	  )
    	)
    ;;;Text for field
    	(command "_text" (getpoint) pause pause strfield)
    	   )
    	 )
    )
      (princ)
    
    )

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: Block and VP scale insert

    Regarding the misplaced dot, you are missing a quote (") character in the creation of your strfield variable.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Block and VP scale insert

    looks like an error here:

    Code:
    >%).CustomScale \\f \"%lu4%pr8%ct2%qf2816 = 1'-0\"\">%

Similar Threads

  1. Get current drawing scale, then insert block via that scale
    By U.Rackharrow in forum VBA/COM Interop
    Replies: 10
    Last Post: 2016-12-09, 03:18 PM
  2. Tag (Multi-View Block) insert scale
    By Hagbard in forum ACA General
    Replies: 6
    Last Post: 2008-09-09, 06:52 PM
  3. Unable to insert Block with different X & Y scale values
    By dorykhay in forum AutoCAD General
    Replies: 5
    Last Post: 2008-07-21, 12:49 PM
  4. Insert a Block with default scale set to 1
    By okillham in forum AutoLISP
    Replies: 8
    Last Post: 2005-05-09, 07:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •