Jump to content

Recommended Posts

Posted

Hello again :)

I'm using this command in my code but I'm having some troubles. The command is not documented at all.

 

I'm using the "_.MAPCREATEFEATUREFROMGEOMETRY" in my code. When I type (command "_.MAPCREATEFEATUREFROMGEOMETRY" sds "" "") in the command line there are no problems. It creats a new feature from the polyline in selection set 'sds'.

But when I implemnt the command inside a autolisp code I get this

 

Command: (load "maptosdf")

C:MAPTOSDF

Command: MAPTOSDF

...DCL_TEST Cancelled.

Select closed curves to select object(s) within: nilnilKP_Broj

1630/7_.MAPCREATEFEATUREFROMGEOMETRY

Erase the selected object after operating [Yes/No]:

Invalid option keyword.

; error: Function cancelled

Erase the selected object after operating [Yes/No]:

Message #0: Cannot convert one of the selected objects.

Geometry

Message code: 1.

Message #1: Cannot convert one of the selected objects.

Geometry

Message code: 1.

Message #2: Cannot convert one of the selected objects.

 

and so on...

Posted

(defun C:listman ()
(setq sds(ssadd))
(ssadd a sds)
(command "_.MAPCREATEFEATUREFROMGEOMETRY" sds "" "" )
)
[code]

So thats basicaly my code. And it's part of a while loop together with some other functions.

(C:INPUT)

 

(C:SELPOL)

 

(C:SSTOLIST)

 

(while (/= sslist nil)

 

(setq guidbr (dos_guidgen))

 

(setq a (car sslist))

 

(setq b (cdr sslist))

 

(C:swc)

 

(C:test)

(princ)

(C:listman)

 

(C:fileh)

 

(setq sslist b)

 

)

[/code]

 

It selects all the polylines and adds them to a list. It promts for user input for some variables that are the same for all parcels and need to be saved only once. Than it takes one parcel at a time from the list. Determines the parcel number inside parcel and saves it to a variable. Generates a GUID number. Than it should create a new feature form object. And finaly print all the variables that it gathert vie file_handle.

Posted

You are still not providing much code. The forum can only guess what all your subs do.

For debugging purposes add (print a) before (command "_.MAPCREATEFEATUREFROMGEOMETRY" ...).

 

BTW: I strongly advise revising your coding style.

Posted

I konw my code doesn't look nice. I'm still pretty new to autolisp and I'm learning as I code. I appreciate your help very much. I managed to solve the problem by adding "(sssetfirst nil nil)" at the top of the code.

Now I have all the data that I need saved to a txt file. I paste the data to excel and have nice organized rows and columns as they should look. The problem is I can't copy paste them into the Map 3D data table. That should be the final step.

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