Results 1 to 3 of 3

Thread: Create Surface by lisp

  1. #1
    Member
    Join Date
    2006-05
    Location
    Tehran-IRAN
    Posts
    22
    Login to Give a bone
    0

    Default Create Surface by lisp

    Hi
    When I want to create a surface from file like this:

    Code:
    (if (findfile "D:/DATA_TEXT/1.txt")
         (createtinfromfile "D:\\DATA_TEXT\\1.txt" "Surf1" "s1" "Standard" "ENZ (comma delimited)")
    )
    I must first create a surface manually in civil 3d
    otherwise can not create surface by lisp
    please help me
    Last edited by BlackBox; 2016-07-30 at 06:19 PM. Reason: Please use [CODE] Tags

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,754
    Login to Give a bone
    0

    Default Re: Create Surface by lisp

    You might want to ask Jeff over in the thread where this function was posted.

    https://forums.autodesk.com/t5/autoc...e/td-p/6341097
    R.K. McSwain | CAD Panacea |

  3. #3
    Woo! Hoo! my 1st post
    Join Date
    2018-04
    Posts
    1
    Login to Give a bone
    0

    Default Re: Create Surface by lisp

    Here, I fixed it ..

    Code:
    (defun createTINfromfile
           (filename surfacename layer stylename fileformat /
    	*acad* c3d c3ddoc datastr names pfiles prodstring surf surfs tincreationdata verstring)
      (vl-load-com)
      (setq	C3D	   (strcat "HKEY_LOCAL_MACHINE\\"
    			   (if vlax-user-product-key
    			     (vlax-user-product-key)
    			     (vlax-product-key)
    			   )
    		   )
    	C3D	   (vl-registry-read C3D "Release")
    	verstring  (substr C3D
    			   1
    			   (vl-string-search
    			     "."
    			     C3D
    			     (+ (vl-string-search "." C3D) 1)
    			   )
    		   )
    	prodstring (strcat "AeccXUiLand.AeccApplication." verstring)
      )
      (setq datastr (strcat "AeccXLand.AeccTinCreationData." verstring))
    
      (if (and (setq *acad* (vlax-get-acad-object))
    	   (setq C3D (vla-getinterfaceobject *acad* prodstring))
    	   (setq C3Ddoc (vla-get-activedocument C3D))
    	   (setq surfs (vlax-get C3Ddoc 'surfaces))
    	   (setq tincreationdata (vla-getinterfaceobject *acad* datastr))
          )
        (progn
          ;;make sure we don't try to use a duplicate name
    	  (vlax-for surf surfs
    	     (setq names (cons (vlax-get surf 'name) names))
    	   )
          (while (member surfacename names)
    	  (setq surfacename (strcat surfacename "(1)"))
          )
          (vlax-put tincreationdata 'baselayer layer)
          (vlax-put tincreationdata 'layer layer)
          (vlax-put tincreationdata 'description "Surface from Lisp")
          (vlax-put tincreationdata 'name surfacename)
          (vlax-put tincreationdata 'style stylename)
          ;;style must exist!
          (setq
    	surf   (vlax-invoke-method surfs 'addtinsurface tincreationdata)
    	pfiles (vlax-get surf 'pointfiles)
          )
          (vlax-invoke-method
    	pfiles 'add filename fileformat	:vlax-false :vlax-false
    	:vlax-false)
          (vlax-invoke surf 'rebuild)
    
          ;; do whatever else is needed
          (vlax-release-object tincreationdata)
          (vlax-release-object surf)
          (vlax-release-object surfs)
          (vlax-release-object c3ddoc)
          (vlax-release-object C3D)
        )
      )
      (princ)
    )

Similar Threads

  1. 2012: Create Surface from Points
    By julia.roberts435830 in forum AutoCAD Civil 3D - Surfaces
    Replies: 8
    Last Post: 2013-10-30, 06:26 PM
  2. Create surface from 3d Cad drawings
    By Wish List System in forum Civil 3D Wish List
    Replies: 2
    Last Post: 2013-10-28, 08:29 PM
  3. Trying to create a terraced surface
    By Dan Johnson in forum AutoCAD Civil 3D - Surfaces
    Replies: 2
    Last Post: 2012-05-24, 05:32 PM
  4. Create surface from txt element
    By TanelF in forum AutoCAD Civil 3D - Surfaces
    Replies: 7
    Last Post: 2010-11-12, 09:13 PM
  5. How do you create surface patterns?
    By clark.72011 in forum Revit - Rendering
    Replies: 8
    Last Post: 2004-07-23, 10:57 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
  •