乐筑天下

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

[编程交流] Problem with vla-addattribute

[复制链接]

4

主题

19

帖子

15

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 11:10:08 | 显示全部楼层 |阅读模式
Hi All,
 
After much searching I can not find an answer to what seems like a simple problem.
 
I want to use vla-attribute to a block which has just been created in my code :-
 
  1. (vla-insertblock    (vla-objectidtoobject adoc (vla-get-ownerid (car ss)))    (vlax-3d point centre)    (vla-get-name blk)    1.0    1.0    1.0    0.0)
 
I have now tried to add the attributes using vla-addattribute, but I can not get it to work. the blk above is the name of the block which is inserted fine and has name e.g Space001 . When I try and add the attributes and I use vla-addAttribute blk (height mode prompt etc) I get error - bad argument type VLA-OBJECT "Space001". If I change the blk to (vla-get-name blk) or (vla-get-block blk) I get error nil VLA-OBJECT.
 
How do get the vla-addattributes to use the block (blk) in the code above, I have tried every combination I can think of including (vlax-ename->vla-object but to no avail.
 
I have managed to get this to work in model space without attaching to a block but can not attach items to the block.
 
Any help will be most welcome
 
John
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:26:18 | 显示全部楼层
John,
 
Did I not provide the code for you to accomplish this???
 
Here in fact.
回复

使用道具 举报

4

主题

19

帖子

15

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 11:36:32 | 显示全部楼层
Hi Lee,
 
Opps my fault, I picked it up the code and then copied some more code over it without thinking. Now see my problem, I have added an odd bit of code which overwrote the block word in the code. It make sense now and works a treat.
 
Carbon interface has failed on the computer today. I'm not used to the sunshine its gone to my head.
 
Many thanks again for you prompt help. It would be ideal if I did'nt mess it up at my end.
 
Regards
 
John
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:53:20 | 显示全部楼层
If you had all these problems, it would have been nice to have some feedback from the other thread as opposed to the creation of a new thread...
回复

使用道具 举报

4

主题

19

帖子

15

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 11:58:48 | 显示全部楼层
My error indeed, I didn't realise until I had posted I had started a new thread. Must stop doing two things at once.
 
I had intended to feed back later on original question, I just got side tracked with some thing else.
 
I am finding it hard getting back into lisp after a 10 year break away from it. But I have learnd a vast amount in the last two days.
 
The problems I know are not big they are just bring me to a halt whilst I try and think how to get over the hurdle.
 
Having spent much time programming in OO and SQL its difficult get back in to the swing of lisp and some of the things that use to be second nature to me.
 
I hope I can contribute back to forum soon in recognition of the help I get..
 
John
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:12:48 | 显示全部楼层
No worries John
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 11:28 , Processed in 0.613890 second(s), 64 queries .

© 2020-2025 乐筑天下

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