×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to make "Isolated Point" in VBScript?

How to make "Isolated Point" in VBScript?

How to make "Isolated Point" in VBScript?

(OP)
Hello, guys



Like upper picture, I wnat to make a isolated point in vbscript.

Also I tried to make this on recording macro. But It was failed.

Could you tell me how to make it?

Thanks a lot,
Mr. Oh

RE: How to make "Isolated Point" in VBScript?

(OP)
Thanks for your reply.

I mean I want to creat a isolated point.

Yesterday, I tried to like this format. This works also what I want.

But I think this is very LONG script. I just want to creat one isolated point. just one point.

So could you creat it as simply?


Set hybridShapeFactory1 = part1.HybridShapeFactory

Set hybridShapePointCoord1 = hybridShapeFactory1.AddNewPointCoord(0, 0, 0)

hybridBody1.AppendHybridShape hybridShapePointCoord1

part1.InWorkObject = hybridShapePointCoord1

part1.Update

Set reference2 = part1.CreateReferenceFromObject(hybridShapePointCoord1)

Set hybridShapePointExplicit1 = hybridShapeFactory1.AddNewPointDatum(reference2)

hybridBody1.AppendHybridShape hybridShapePointExplicit1

part1.InWorkObject = hybridShapePointExplicit1

hybridShapeFactory1.DeleteObjectForDatum reference2

part1.Update

RE: How to make "Isolated Point" in VBScript?

Hello,
I am trying to make a replace feature. It also works with startcommand function?

RE: How to make "Isolated Point" in VBScript?

Why do you wanna do this? Just curious.

RE: How to make "Isolated Point" in VBScript?

In my template of part I have an axis system, that I need to replace to work in the assembly position. My parts are always located in 0,0,0. But the drawn part most of the time no. So I need to copy with link an axis system that is located in a skeleton part, and then replace the one that I have in the new part.

RE: How to make "Isolated Point" in VBScript?

Your code looks right. Remember, regardless of how long the code is, it would take much, much longer to create the point manually.

You can shorten the recorded variable names and remove unnecessary lines to shorten it. Also, some creation features do not need a reference...I can't remember if PointDatum is one, but you can give it a try.

Also, use the code blocks. Below code takes you from 11 lines to 7.

CODE -->

Set hybridShapeFactory1 = part1.HybridShapeFactory

Set hybridShapePointCoord1 = hybridShapeFactory1.AddNewPointCoord(0, 0, 0)
'If you are deleting the point, no need to append it
'hybridBody1.AppendHybridShape hybridShapePointCoord1
'New features are automatically the InWorkObject...and this is not needed
'part1.InWorkObject = hybridShapePointCoord1
'I would be careful updating the entire part...if the user has a feature that fails, the code will fail here
'part1.Update 
'Instead, local update only what you created
hybridShapePointCoord1.compute
'Try getting rid of the reference
'Set reference2 = part1.CreateReferenceFromObject(hybridShapePointCoord1)
'Use the point instead of the reference
Set hybridShapePointExplicit1 = hybridShapeFactory1.AddNewPointDatum(hybridShapePointCoord1)

hybridBody1.AppendHybridShape hybridShapePointExplicit1
'Local update
hybridShapePointCoord1.compute
'Don't need
'part1.InWorkObject = hybridShapePointExplicit1

hybridShapeFactory1.DeleteObjectForDatum hybridShapePointCoord1

'part1.Update 

RE: How to make "Isolated Point" in VBScript?

I'd just suck it down and do it manually, I don't give a fuck, I once File > Save As about 3000 files on Unix. Could I have written a macro? Yeah if I knew how it all worked under Unix and CATIA V4. So I just said: "fuck it." and I did it by hand.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources