ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem in WBLOCK command

4 REPLIES 4
Reply
Message 1 of 5
kimi
371 Views, 4 Replies

Problem in WBLOCK command

Hi ,

I am using WBLOCK command in my ARX application.

I am using two forms of wblock command as explained below: ( I am facing problem in second form)

1. Writing created block in a new file using WBLOCK command:

I have created a block and using WBLCOK command I am writing this block in a new file. I am succeeding here.

Following is related code:

/***********************
Char filepath[20] =”C:\\Test.dwg”;

ads_command(RTSTR, “WBLOCK”,RTSTR, filepath,RTSTR,blkname,RTNONE);

// blkname is name of block I have created
*******************************/
This is working fine.

2. Writing selected entities in a new file using WBLOCK command: (use of base point option of wblock command)

I have created a circle and want to write this circle in a new drawing using WBLOCK command:

I have used following code:

//// some code for circle creation

Char filepath2[20] =”C:\\Test2.dwg”;
ads_name ent;
ads_entlast(ent)
ads_point pt ={0,0,0};

ads_command(RTSTR, “WBLOCK”,RTSTR, filepath2,RTNONE,RT3DPOINT,pt,RTENAME,ent,RTNONE);

Here I am not able to write created circle in a new drawing:

Actually I am doing following steps programmatically:

1. WBLOCK command at prompt.
2. Give name of new drawing
3. Give base point
4. Give entity for writing

What is going wrong in my “ads_command” parameters?

Thanks in advance.
KIMI
4 REPLIES 4
Message 2 of 5
davidm_adn
in reply to: kimi

Could be wrong, but I think WBLOCK requires a selection set, not just one entity. Try sending a return (RTSTR, "") after the ads_name, as if you're telling the WBLOCK command that the selection set is complete.
Message 3 of 5
Anonymous
in reply to: kimi

Hi Kimi,

try this

ads_command(RTSTR, “WBLOCK”, RTSTR, filepath2, RTSTR, "", RT3DPOINT, pt,
RTENAME,ent,RTSTR, "",RTNONE);

by theway: in R2000 & up you should use acedCommand() function
although ads_command() is still working

Moshe

wrote in message news:5059335@discussion.autodesk.com...
Hi ,

I am using WBLOCK command in my ARX application.

I am using two forms of wblock command as explained below: ( I am facing
problem in second form)

1. Writing created block in a new file using WBLOCK command:

I have created a block and using WBLCOK command I am writing this block in a
new file. I am succeeding here.

Following is related code:

/***********************
Char filepath[20] =”C:\\Test.dwg”;

ads_command(RTSTR, “WBLOCK”,RTSTR, filepath,RTSTR,blkname,RTNONE);

// blkname is name of block I have created
*******************************/
This is working fine.

2. Writing selected entities in a new file using WBLOCK command: (use of
base point option of wblock command)

I have created a circle and want to write this circle in a new drawing using
WBLOCK command:

I have used following code:

//// some code for circle creation

Char filepath2[20] =”C:\\Test2.dwg”;
ads_name ent;
ads_entlast(ent)
ads_point pt ={0,0,0};

ads_command(RTSTR, “WBLOCK”,RTSTR,
filepath2,RTNONE,RT3DPOINT,pt,RTENAME,ent,RTNONE);

Here I am not able to write created circle in a new drawing:

Actually I am doing following steps programmatically:

1. WBLOCK command at prompt.
2. Give name of new drawing
3. Give base point
4. Give entity for writing

What is going wrong in my “ads_command” parameters?

Thanks in advance.
KIMI
Message 4 of 5
kimi
in reply to: kimi

Thanks Moshe !! I will try your suggestion!!
Message 5 of 5
kimi
in reply to: kimi

Hi Moshe,

It works. Thanks a lot

Regards,
Kimi

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost