create parcel by lisp(no dialog box showing up)

create parcel by lisp(no dialog box showing up)

mehdi-guida
Advocate Advocate
1,572 Views
11 Replies
Message 1 of 12

create parcel by lisp(no dialog box showing up)

mehdi-guida
Advocate
Advocate

Hi

i want to make parcels by existing objects by LISP. but i could not  deactivate the windows and dialog boxes. how can i make parcels by lisp?

0 Likes
1,573 Views
11 Replies
Replies (11)
Message 2 of 12

dlanorh
Advisor
Advisor
Post the lisp that failed, sometimes there are ways around dialog boxes. Failing that post an example drawing showing before and after so everyone knows what you are trying to achieve and with what.

I am not one of the robots you're looking for

0 Likes
Message 3 of 12

Sea-Haven
Mentor
Mentor

Are you talking about CIV3D parcels ? If so there may be sample code available in Vlisp, VBA or .net, I think I have seen it mentioned.

0 Likes
Message 4 of 12

Sea-Haven
Mentor
Mentor

Just search your Autodesk directory for parcelsample.dvb and open it up in VBAMAN then will expose all the method to use in VLISP.

0 Likes
Message 5 of 12

mehdi-guida
Advocate
Advocate

attdia can help for not showing dialog boxes in a Lisp file.

but it doesn't work for 'CreateParcelFromObjects'.

how can i deactivate dialog boxes to use 'CreateParcelFromObjects' in a Lisp program?

0 Likes
Message 6 of 12

Sea-Haven
Mentor
Mentor

You have to via a program select objects, then again create parcels, all being done from a equivalent to the default "createparcels" but with out the dcl.

 

That is what is in the VBA sample code.

0 Likes
Message 7 of 12

mehdi-guida
Advocate
Advocate

maybe i didn't understand correctly.

suppose the selection set named "S1" include objects for making parcels.

what is the lisp codes that make parcels by 'S1' (with no dcl)?

0 Likes
Message 8 of 12

Ajilal.Vijayan
Advisor
Advisor

try this code

The below code is based on the solution from here

(defun c:test ( / C3D *acad* prodstring C3Ddoc sites site parcelsegments s i e )

;;;https://forums.autodesk.com/t5/civil-3d-forum/lisp-to-create-civil-3d-surface-from-point-file/m-p/6342001#M302637
  (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)
  )
  
    (if (and (setq *acad* (vlax-get-acad-object))
	   (setq C3D (vla-getinterfaceobject *acad* prodstring))
	   (setq C3Ddoc (vla-get-activedocument C3D))
	   (setq sites (vlax-get C3Ddoc 'sites))
	   );and
	   (progn
	   (if (> (vlax-get sites 'count) 0)
		(progn
			(setq site (vla-item sites 0));;<-- using the first site,(Change the number Zero to use different Site name)
			(setq parcelsegments (vlax-get site 'ParcelSegments))
			(if (setq s (ssget))
			(progn
				(setq i (1- (sslength s)))
				(while (<= 0 i)
					(setq e (ssname s i)
						  i (1- i)
					)
					(vlax-invoke-method parcelsegments 'AddFromEntity (vlax-ename->vla-object e) T)
				)
			)
		);if
		(vlax-release-object sites)
		(vlax-release-object C3Ddoc)
		(vlax-release-object C3D)
		);progn
		(princ "**Sites not found, at least one site is required**")
	   );if
	  );progn
	);if
	(princ)
);defun

 

0 Likes
Message 9 of 12

mehdi-guida
Advocate
Advocate

Thank you so much

can i use that for making alignments?

 

0 Likes
Message 10 of 12

Sea-Haven
Mentor
Mentor

Your missing the point about what I am saying there is multiple sample code for creating different objects within CIV3D. Like Pipes, alignments, points, surfaces etc. Its in the Sample directory c:\program files\Autodesk …….

 

I wrote code for description key sets as there was no IMPORT or multiple change function.

 

I also have replaced the Toolbox selecting surface settings with icons much easier. Getting into CIV3d is not a quick thing. 

 

 

0 Likes
Message 11 of 12

mehdi-guida
Advocate
Advocate

Thank you

How can i know more about your codes and programs?

 

0 Likes
Message 12 of 12

Sea-Haven
Mentor
Mentor

Have a look at this load the 2 menu files. It has read me etc. For contours need you contour style names.

 

 

 

0 Likes