乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 27|回复: 4

[编程交流] _.mapcreatefeaturefromgeometry

[复制链接]

3

主题

7

帖子

4

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 17:30:29 | 显示全部楼层 |阅读模式
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...
回复

使用道具 举报

18

主题

1529

帖子

973

银币

中流砥柱

Rank: 25

铜币
649
发表于 2022-7-5 17:57:07 | 显示全部楼层
Please post your code.
回复

使用道具 举报

3

主题

7

帖子

4

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 18:05:10 | 显示全部楼层
  1. (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.
回复

使用道具 举报

18

主题

1529

帖子

973

银币

中流砥柱

Rank: 25

铜币
649
发表于 2022-7-5 18:27:19 | 显示全部楼层
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.
回复

使用道具 举报

3

主题

7

帖子

4

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 18:42:33 | 显示全部楼层
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.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 03:16 , Processed in 0.431456 second(s), 62 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表